add cronjob
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2024-11-26 18:00:29 +01:00
parent e3e08d0b1d
commit 700a349e55
4 changed files with 22 additions and 0 deletions

View File

@ -17,6 +17,8 @@ steps:
DOMAIN: {{ .Name }}.swarm-test.autonomic.zone
STACK_NAME: {{ .Name }}
LETS_ENCRYPT_ENV: production
CRON_ENTRYPOINT_VERSION: v1
PRETIX_CONFIG_VERSION: v1
trigger:
branch:
- main

View File

@ -1 +1,2 @@
export PRETIX_CONFIG_VERSION=v1
export CRON_ENTRYPOINT_VERSION=v1

View File

@ -68,6 +68,19 @@ services:
networks:
- internal
cron:
image: alpinelinux/docker-cli:latest
environment:
- STACK_NAME=${STACK_NAME}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
entrypoint:
/entrypoint.sh
configs:
- source: cron_entrypoint
target: /entrypoint.sh
mode: 0555
volumes:
app:
postgres:
@ -78,6 +91,9 @@ configs:
name: ${STACK_NAME}_pretix_config_${PRETIX_CONFIG_VERSION}
file: pretix.cfg.tmpl
template_driver: golang
cron_entrypoint:
name: ${STACK_NAME}_cron_entrypoint_${CRON_ENTRYPOINT_VERSION}
file: entrypoint.cron.sh
networks:
proxy:

3
entrypoint.cron.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
echo '15,45 * * * * docker exec $(docker ps -qf 'name=${STACK_NAME}_app') pretix runperiodic' | crontab - && crond -f -d 8