services: web: build: context: ./web dockerfile: Dockerfile.prod args: NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-} INTERNAL_API_ORIGIN: ${INTERNAL_API_ORIGIN:-http://api:8000} restart: unless-stopped ports: - "${WEB_PORT:-3000}:3000" environment: NODE_ENV: production NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-} INTERNAL_API_ORIGIN: ${INTERNAL_API_ORIGIN:-http://api:8000} API_BEARER_TOKEN: ${API_BEARER_TOKEN:-} depends_on: api: condition: service_healthy healthcheck: test: [ "CMD", "node", "-e", "fetch('http://127.0.0.1:3000/health').then((res) => process.exit(res.ok ? 0 : 1)).catch(() => process.exit(1))", ] interval: 30s timeout: 10s retries: 3 start_period: 30s networks: - app-network api: build: context: ./api dockerfile: Dockerfile restart: unless-stopped command: ["sh", "/app/scripts/run_api.sh"] ports: - "${API_BIND_HOST:-127.0.0.1}:${API_PORT:-8000}:8000" volumes: - api-data:/app/data - ./.env:/app/.env - paddlex-cache:/root/.paddlex - paddle-cache:/root/.cache/paddle env_file: - .env environment: APP_SERVICE_ROLE: api depends_on: redis: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"] interval: 30s timeout: 10s retries: 3 start_period: 240s networks: - app-network worker: build: context: ./api dockerfile: Dockerfile restart: unless-stopped command: ["sh", "/app/scripts/run_worker.sh"] volumes: - api-data:/app/data - paddlex-cache:/root/.paddlex - paddle-cache:/root/.cache/paddle env_file: - .env environment: APP_SERVICE_ROLE: worker depends_on: redis: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import redis; r=redis.from_url('redis://redis:6379/0'); r.ping()"] interval: 30s timeout: 10s retries: 3 start_period: 240s networks: - app-network redis: image: redis:7-alpine restart: unless-stopped command: redis-server --save "" --appendonly no healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 3s retries: 5 networks: - app-network networks: app-network: driver: bridge volumes: api-data: paddlex-cache: paddle-cache: