services: # Backend API Server backend: build: context: . dockerfile: Dockerfile.backend container_name: flight-radar-backend restart: unless-stopped ports: - "8000:8000" environment: - PORT=8000 - DATABASE_PATH=/app/data/cache.db - ALLOWED_ORIGINS=http://localhost,http://localhost:80,http://frontend volumes: - backend-data:/app/data - ./cache.db:/app/cache.db:rw networks: - flight-radar-network healthcheck: test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8000/health').raise_for_status()"] interval: 30s timeout: 3s retries: 3 start_period: 10s # Frontend UI frontend: build: context: . dockerfile: Dockerfile.frontend container_name: flight-radar-frontend restart: unless-stopped ports: - "80:80" depends_on: backend: condition: service_healthy networks: - flight-radar-network healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"] interval: 30s timeout: 3s retries: 3 start_period: 5s networks: flight-radar-network: driver: bridge volumes: backend-data: driver: local