Dockerfile to run Shreddit as an hourly cron job
I was wondering if you would be interested in having a docker image for this repo. DockerHub provides automated docker builds if you setup an integration with Github, so once it is setup things should be pretty hands off unless the installation steps change.
If you are not interested in having the dockerfile be part of your project, I can manage the dockerfile in a separate repo. If this happens, would you be interested in adding a push_event so that I can have the image rebuild each time you commit?
I personally would be absolutely happy to have a docker file to do exactly this. Hourly is a little often but weekly would be absolutely fantastic.
Hourly is a little often but weekly would be absolutely fantastic.
I'd go with daily. Seems like a nice compromise.
This absolutely needs to happen, is it? Running Shreddit manually is a pain.
Someone?
For now you could use a timer, or a cron job :)
Would you mind quickly telling me how to do this? I'd like to have it setup on a server that is always running so it actually does do this properly. I guess I'd need to install python or something too of course. I'm not using any VMs on my server, just Docker. Is it possible to do it with that or?
I'm not using any VMs on my server, just Docker. Is it possible to do it with that or?
Well, on your host system you should add an entry to the crontab, which executes the script (doesn't matter if within a docker container or not) in a specific interval.
The entry in the crontab for running the script, for example, every 15 minutes within a docker container could look like this:
echo "*/15 * * * * root /usr/bin/docker exec docker-shreddit -s /bin/bash -c '/path/to/the/script.sh'"
I made an image this week which has support for any CRON schedule:
https://github.com/MitchTalmadge/shreddit-dockerized
Enjoy
https://github.com/kusold/Shreddit
I setup automatic publishing of docker images on my repo. It does not include cron inside the image, you can manage that with k8s, or just a host level cron job.
My fork also makes this compatible with Python 3.