version: '3.8' services: # 后端服务 backend: build: context: ./backend dockerfile: Dockerfile container_name: mirofish-backend ports: - "5001:5001" environment: - FLASK_HOST=0.0.0.0 - FLASK_PORT=5001 - FLASK_DEBUG=false env_file: - .env volumes: # 持久化上传文件和模拟数据 - ./data/uploads:/app/uploads restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:5001/health"] interval: 30s timeout: 10s retries: 3 # 前端服务 frontend: build: context: ./frontend dockerfile: Dockerfile args: - VITE_API_BASE_URL=http://backend:5001 container_name: mirofish-frontend ports: - "3000:80" depends_on: - backend restart: unless-stopped networks: default: name: mirofish-network