version: '3.8' services: # 后端服务 backend: build: context: . dockerfile: deploy/Dockerfile.backend container_name: cultivation-backend ports: - "8002:8002" environment: - PYTHONUNBUFFERED=1 restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8002/api/state"] interval: 30s timeout: 10s retries: 3 start_period: 30s volumes: - ./assets/saves:/app/assets/saves - ./logs:/app/logs # 前端服务 frontend: build: context: . dockerfile: deploy/Dockerfile.frontend container_name: cultivation-frontend ports: - "8123:80" depends_on: - backend restart: unless-stopped healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"] interval: 30s timeout: 10s retries: 3