Switch to ofelia scheduler for weekly digest cron
This commit is contained in:
parent
4c4f2b437e
commit
7cfe936e13
1 changed files with 10 additions and 19 deletions
|
|
@ -130,29 +130,20 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- elmeg
|
- elmeg
|
||||||
|
|
||||||
# Weekly digest email cron job (runs Sunday 9am UTC)
|
# Weekly digest email scheduler
|
||||||
cron:
|
scheduler:
|
||||||
build: ./backend
|
image: mcuadros/ofelia:latest
|
||||||
|
command: daemon --docker
|
||||||
volumes:
|
volumes:
|
||||||
- ./backend:/app
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
environment:
|
labels:
|
||||||
- DATABASE_URL=${DATABASE_URL:-postgresql://elmeg:elmeg_password@db:5432/elmeg}
|
# Run weekly digest every Sunday at 9am UTC
|
||||||
- SMTP_HOST=${SMTP_HOST}
|
- "ofelia.job-exec.weekly-digest.schedule=0 9 * * 0"
|
||||||
- SMTP_PORT=${SMTP_PORT:-25}
|
- "ofelia.job-exec.weekly-digest.container=elmeg-demo-backend-1"
|
||||||
- SMTP_USERNAME=${SMTP_USERNAME}
|
- "ofelia.job-exec.weekly-digest.command=python services/weekly_digest.py"
|
||||||
- SMTP_PASSWORD=${SMTP_PASSWORD}
|
|
||||||
- SMTP_USE_TLS=${SMTP_USE_TLS:-true}
|
|
||||||
- EMAIL_FROM=${EMAIL_FROM:-noreply@elmeg.xyz}
|
|
||||||
- FRONTEND_URL=${FRONTEND_URL:-https://elmeg.xyz}
|
|
||||||
command: >
|
|
||||||
sh -c "echo '0 9 * * 0 cd /app && python services/weekly_digest.py >> /var/log/cron.log 2>&1' | crontab - && crond -f -l 2"
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
- backend
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- elmeg
|
- elmeg
|
||||||
- postal-internal
|
|
||||||
|
|
||||||
umami:
|
umami:
|
||||||
image: ghcr.io/umami-software/umami:postgresql-latest
|
image: ghcr.io/umami-software/umami:postgresql-latest
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue