HOTFIX: add docker prune to debian_swarm_deploy.sh
@@ -71,6 +71,8 @@ printf "${TWLIGHT_EZPROXY_SECRET}" | docker secret create TWLIGHT_EZPROXY_SECRET
docker stack deploy -c "docker-compose.yml" -c "docker-compose.${TWLIGHT_STACK_ENV}.yml" "${TWLIGHT_STACK_ENV}"
echo "Setting up crontab. *WARNING* This will create duplicate jobs if run repeatedly."
+(crontab -l 2>/dev/null; echo "# Reclaim disk space previously used by docker.") | crontab -
+(crontab -l 2>/dev/null; echo '0 5 * * * docker system prune -a -f; docker volume rm $(docker volume ls -qf dangling=true)') | crontab -
(crontab -l 2>/dev/null; echo "# Run django_cron tasks.") | crontab -
(crontab -l 2>/dev/null; echo '*/5 * * * * docker exec -t $(docker ps -q -f name="${TWLIGHT_STACK_ENV}_twlight") /app/bin/twlight_docker_entrypoint.sh python manage.py runcrons') | crontab -
(crontab -l 2>/dev/null; echo "# Update the running TWLight service if there is a new image. The initial pull is just to verify that the image is valid. Otherwise an inaccessible image could break the service.") | crontab -
