Server already has Redis and PostgreSQL running. Worker uses network_mode: host to connect directly, no port conflicts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
922 B
YAML
27 lines
922 B
YAML
# Production Docker Compose — worker only
|
|
# Uses host Redis + PostgreSQL (already running on server)
|
|
# Apache/Nginx on host serves PHP + frontend files natively
|
|
|
|
services:
|
|
worker:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.worker
|
|
network_mode: host
|
|
volumes:
|
|
- ${WEB_DIR:-/var/www/html/pdf-accessibility}/uploads:/app/uploads
|
|
- ${WEB_DIR:-/var/www/html/pdf-accessibility}/results:/app/results
|
|
- ./logs:/app/logs
|
|
environment:
|
|
- REDIS_HOST=${REDIS_HOST:-127.0.0.1}
|
|
- REDIS_PORT=${REDIS_PORT:-6379}
|
|
- DB_HOST=${DB_HOST:-127.0.0.1}
|
|
- DB_PORT=${DB_PORT:-5432}
|
|
- DB_NAME=${DB_NAME:-pdf_checker}
|
|
- DB_USER=${DB_USER:-pdf_checker}
|
|
- DB_PASSWORD=${DB_PASSWORD:-dev_password}
|
|
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
|
|
- GOOGLE_API_KEY=${GOOGLE_API_KEY:-}
|
|
deploy:
|
|
replicas: ${WORKER_COUNT:-2}
|
|
restart: unless-stopped
|