buff0k / indigo-docker

A method of deploying Indigo to Docker using Docker-Compose and Dockerfile
MIT License
0 stars 0 forks source link

Create CRON job for background tasks #3

Open buff0k opened 1 year ago

buff0k commented 1 year ago

Create a cron job for background tasks to run from the container.

buff0k commented 1 year ago

Add to Dockerfile: apt install cron --no-install-recommends -y RUN crontab -l | { cat; echo "/5 * python /src/indigo/manage.py process_tasks --duration 180"; } | crontab -

Add to entrypoint.sh: cron

Edit /src/indigo/indigo/settings.py DJANGO_BACKGROUND_TASKS=True

buff0k commented 1 year ago

Testing with the sed command in Dockerfile build

buff0k commented 1 year ago

Perhaps look into this as a fix to the current issue

cd /home/username/appname && /home/username/virtualenv/bin/python /home/username/appname/manage.py process_tasks --duration 3540