Worker: separate containers for e-mail and AI generation
CI / test (push) Successful in 1m9s
CI / build (push) Successful in 4m9s
CI / deploy (push) Skipped

WORKER_TASKS (email, cleanup, analyses; all by default) picks the jobs of a
worker process. In production the worker sends e-mails and cleans up (and
will take the other background jobs), worker-ai writes the analyses and
answers with its quick and slow lanes, sized from the server's .env.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-19 06:51:45 +00:00
co-authored by Claude Opus 5.5
parent bc0227042b
commit da533e8fa9
7 changed files with 81 additions and 2 deletions
+22
View File
@@ -99,10 +99,12 @@ services:
logging: *logging
restart: unless-stopped
# E-mail delivery, cleanup and the other background jobs.
worker:
image: ${REGISTRY_PREFIX:-registry.sagifer.com/sagifer/sorsfonalak}-worker:${TAG:-latest}
environment:
DATABASE_URL: postgres://sorsfonalak:${POSTGRES_PASSWORD}@postgres:5432/sorsfonalak
WORKER_TASKS: email,cleanup
# SMTP_URL or the SES credentials come from .env.secrets (docs/levelkuldes.md);
# listing them here with an empty default would override that file.
SES_REGION: ${SES_REGION:-eu-central-1}
@@ -118,6 +120,26 @@ services:
logging: *logging
restart: unless-stopped
# The same image writing the analyses and answers (quick and slow lane);
# OPENROUTER_API_KEY comes from .env.secrets.
worker-ai:
image: ${REGISTRY_PREFIX:-registry.sagifer.com/sagifer/sorsfonalak}-worker:${TAG:-latest}
environment:
DATABASE_URL: postgres://sorsfonalak:${POSTGRES_PASSWORD}@postgres:5432/sorsfonalak
WORKER_TASKS: analyses
QUICK_CONCURRENCY: ${QUICK_CONCURRENCY:-2}
ANALYSIS_CONCURRENCY: ${ANALYSIS_CONCURRENCY:-4}
PUBLIC_BASE_URL: https://${DOMAIN}
env_file:
- path: .env.secrets
required: false
depends_on:
postgres:
condition: service_healthy
read_only: true
logging: *logging
restart: unless-stopped
frontend:
image: ${REGISTRY_PREFIX:-registry.sagifer.com/sagifer/sorsfonalak}-frontend:${TAG:-latest}
environment: