Shreddit icon indicating copy to clipboard operation
Shreddit copied to clipboard

Dockerfile to run Shreddit as an hourly cron job

Open kusold opened this issue 8 years ago • 8 comments

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?

kusold avatar Aug 18 '17 04:08 kusold

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.

ghost avatar Oct 19 '17 09:10 ghost

Hourly is a little often but weekly would be absolutely fantastic.

I'd go with daily. Seems like a nice compromise.

KopfKrieg avatar Jun 22 '18 18:06 KopfKrieg

This absolutely needs to happen, is it? Running Shreddit manually is a pain.

Someone?

ghost avatar Aug 18 '18 17:08 ghost

For now you could use a timer, or a cron job :)

KopfKrieg avatar Aug 18 '18 20:08 KopfKrieg

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?

ghost avatar Aug 23 '18 21:08 ghost

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'"

KopfKrieg avatar Aug 25 '18 22:08 KopfKrieg

I made an image this week which has support for any CRON schedule:

https://github.com/MitchTalmadge/shreddit-dockerized

Enjoy

MitchTalmadge avatar Jun 11 '20 06:06 MitchTalmadge

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.

kusold avatar May 11 '22 22:05 kusold