services: app: build: context: . target: ${DOCKER_TARGET:-release} args: PORT: ${PORT:-3000} # Remove ports when using Cloudflare Tunnel (app not directly accessible) ports: - "${PORT:-3000}:${PORT:-3000}" volumes: - app_data:/usr/src/app/data - app_user_data:/usr/src/app/user_data env_file: - .env.prod environment: - NODE_ENV=production - API_URL=${API_URL} restart: always healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:${PORT:-3000}/"] interval: 30s timeout: 5s retries: 3 start_period: 10s scheduler: build: context: . target: ${DOCKER_TARGET:-release} args: PORT: ${PORT:-3000} volumes: - app_data:/usr/src/app/data - app_user_data:/usr/src/app/user_data env_file: - .env.prod environment: - NODE_ENV=production - API_URL=${API_URL} command: ["bun", "run", "scripts/schedule.ts"] restart: always depends_on: app: condition: service_healthy cloudflared: image: cloudflare/cloudflared:latest restart: always command: tunnel run depends_on: app: condition: service_healthy environment: - TUNNEL_TOKEN=${CF_TUNNEL_TOKEN} logging: driver: "json-file" options: max-size: "5m" max-file: "2" networks: - default volumes: app_data: app_user_data: