add cronjob
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
@ -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
|
||||
|
16
compose.yml
16
compose.yml
@ -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
3
entrypoint.cron.sh
Normal 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
|
Reference in New Issue
Block a user