version: "3.9" services: backend: build: context: ./backend container_name: stellar-goal-vault-backend ports: - "3001:3001" env_file: - ./backend/.env restart: unless-stopped healthcheck: # Probe the backend REST API health endpoint. # interval: how often Docker polls after the container starts. # timeout: how long a single probe may take before it is considered failed. # retries: consecutive failures before the container is marked unhealthy. # start_period: grace window after container start before failures count. test: ["CMD", "curl", "-f", "http://localhost:3001/api/health"] interval: 15s timeout: 5s retries: 3 start_period: 10s frontend: build: context: ./frontend container_name: stellar-goal-vault-frontend ports: - "3000:3000" environment: - VITE_API_URL=http://backend:3001/api depends_on: # Wait until the backend passes its health check before starting frontend. backend: condition: service_healthy restart: unless-stopped healthcheck: # Probe the frontend HTTP server root. # Same timing parameters as the backend for consistency. test: ["CMD", "curl", "-f", "http://localhost:3000"] interval: 15s timeout: 5s retries: 3 start_period: 10s