ItsEcholot / ContainerNursery

Puts Docker Containers to sleep and wakes them back up when they're needed
MIT License
94 stars 6 forks source link

Define the period when the container must remain on #25

Open JamesDAdams opened 2 years ago

JamesDAdams commented 2 years ago

Hi,

It would be great a feature to define in period when the container must remain on. For example I have a youtubeDL container that I don't need to have all the time on, but I would like it to stay on 1 -2h in the night to automatically download the videos

An exemple of option in the config.yml :

  - domain: youtubedl.domaine.com
    containerName: YoutubeDL
    proxyHost: 192.168.0.104
    proxyPort: 8080
    timeoutSeconds: 300
    wakingUpPeriod: ['2am:4am', '2pm:3pm'] //Multiple period
kn-f commented 1 year ago

@JamesDAdams did you try by setting up a curl cron job for this behaviour? This can be done either on the server or inside the ContainerNurse container, in case you don't want to mess with the server crontab. In your case it could be something like: * 2-4,14-15 * * * curl youtubedl.domaine.com Basically every minute curl will make an http request to the web page mentioned to keep it alive. You can play around with the frequency of this command but running it every minute will have a negligible impact on your system.