services: ai-service: build: context: ./ai-service dockerfile: Dockerfile container_name: aitasker-ai ports: - "8000:8000" env_file: - ./ai-service/.env healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"] interval: 15s timeout: 10s retries: 5 start_period: 20s restart: unless-stopped backend: build: context: ./backend dockerfile: Dockerfile container_name: aitasker-backend ports: - "3001:3000" # host:container — avoids clash with Docker Desktop on 3000 env_file: - ./backend/.env environment: FASTAPI_URL: http://ai-service:8000 PORT: 3000 # container-internal port; host maps 3001→3000 in ports above depends_on: ai-service: condition: service_healthy healthcheck: test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health',r=>process.exit(r.statusCode===200?0:1)).on('error',()=>process.exit(1))"] interval: 10s timeout: 5s retries: 10 start_period: 15s restart: unless-stopped frontend: build: context: ./frontend dockerfile: Dockerfile args: # Vite bakes this into the JS bundle at build time. # Points to host port 3001 (where Docker maps the backend). # Only used when accessing frontend from outside Docker. # The nginx proxy inside Docker always uses backend:3000 directly. VITE_API_BASE_URL: http://localhost:3001 VITE_WS_URL: http://localhost:3001 container_name: aitasker-frontend ports: - "80:80" depends_on: backend: condition: service_healthy healthcheck: test: ["CMD", "wget", "-qO-", "http://localhost/"] interval: 15s timeout: 5s retries: 3 restart: unless-stopped