version: '3.8' services: video-api: build: . container_name: hs-video-api ports: - "5000:5000" environment: - FLASK_ENV=production - SECRET_KEY=your-secret-key-here volumes: - ./logs:/app/logs - ./uploads:/app/uploads restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:5000/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s networks: - video-api-network # 可选:添加Redis用于任务状态持久化 # redis: # image: redis:7-alpine # container_name: hs-video-redis # ports: # - "6379:6379" # volumes: # - redis_data:/data # restart: unless-stopped # networks: # - video-api-network # 可选:添加Nginx反向代理 # nginx: # image: nginx:alpine # container_name: hs-video-nginx # ports: # - "80:80" # - "443:443" # volumes: # - ./nginx.conf:/etc/nginx/nginx.conf:ro # - ./ssl:/etc/nginx/ssl:ro # depends_on: # - video-api # restart: unless-stopped # networks: # - video-api-network networks: video-api-network: driver: bridge volumes: # redis_data: logs: uploads: