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:
|
||||
- elmeg
|
||||
|
||||
# Weekly digest email cron job (runs Sunday 9am UTC)
|
||||
cron:
|
||||
build: ./backend
|
||||
# Weekly digest email scheduler
|
||||
scheduler:
|
||||
image: mcuadros/ofelia:latest
|
||||
command: daemon --docker
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
environment:
|
||||
- DATABASE_URL=${DATABASE_URL:-postgresql://elmeg:elmeg_password@db:5432/elmeg}
|
||||
- SMTP_HOST=${SMTP_HOST}
|
||||
- SMTP_PORT=${SMTP_PORT:-25}
|
||||
- SMTP_USERNAME=${SMTP_USERNAME}
|
||||
- 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
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
labels:
|
||||
# Run weekly digest every Sunday at 9am UTC
|
||||
- "ofelia.job-exec.weekly-digest.schedule=0 9 * * 0"
|
||||
- "ofelia.job-exec.weekly-digest.container=elmeg-demo-backend-1"
|
||||
- "ofelia.job-exec.weekly-digest.command=python services/weekly_digest.py"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- elmeg
|
||||
- postal-internal
|
||||
|
||||
umami:
|
||||
image: ghcr.io/umami-software/umami:postgresql-latest
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue