| services: | |
| redis: | |
| image: redis:6-alpine | |
| container_name: job-app-redis | |
| ports: | |
| - "6379:6379" | |
| healthcheck: | |
| test: ["CMD", "redis-cli", "ping"] | |
| interval: 5s | |
| timeout: 3s | |
| retries: 5 | |
| start_period: 10s | |
| restart: unless-stopped | |
| networks: | |
| - job-app-network | |
| postgres: | |
| image: postgres:16-alpine | |
| container_name: job-app-postgres | |
| environment: | |
| - POSTGRES_USER=postgres | |
| - POSTGRES_PASSWORD=postgres | |
| - POSTGRES_DB=postgres | |
| ports: | |
| - "5432:5432" | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U postgres"] | |
| interval: 5s | |
| timeout: 5s | |
| retries: 5 | |
| start_period: 10s | |
| volumes: | |
| - pg_data_local:/var/lib/postgresql/data | |
| restart: unless-stopped | |
| networks: | |
| - job-app-network | |
| agent: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| image: job-app-workflow:latest # Consider versioned tag in production | |
| container_name: job-app-agent | |
| ports: | |
| - "7860:7860" | |
| environment: | |
| - PORT=7860 | |
| - LANGGRAPH_PORT=7860 | |
| - REDIS_URI=redis://redis:6379 | |
| - DATABASE_URI=postgresql://postgres:postgres@postgres:5432/postgres | |
| env_file: | |
| - .docker_env | |
| healthcheck: | |
| test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:7860/ok')"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 40s | |
| restart: unless-stopped | |
| depends_on: | |
| redis: | |
| condition: service_healthy | |
| postgres: | |
| condition: service_healthy | |
| networks: | |
| - job-app-network | |
| # Optional: Resource limits (uncomment for production) | |
| # deploy: | |
| # resources: | |
| # limits: | |
| # cpus: '2' | |
| # memory: 4G | |
| # reservations: | |
| # cpus: '1' | |
| # memory: 2G | |
| networks: | |
| job-app-network: | |
| driver: bridge | |
| volumes: | |
| pg_data_local: |