version: "3.9" services: backend: build: context: ./backend dockerfile: Dockerfile image: backup-system/backend:latest container_name: backup-backend env_file: - .env environment: # 容器内默认存储根目录 STORAGE_LOCAL_ROOT: /app/data/backups DATABASE_URL: sqlite:////app/data/backup.db volumes: # bind mounts: 数据直接落到项目目录下 - ./data/backend:/app/data - ./data/logs:/app/logs ports: - "8765:8000" restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"] interval: 30s timeout: 5s retries: 5 start_period: 20s frontend: build: context: ./frontend dockerfile: Dockerfile image: backup-system/frontend:latest container_name: backup-frontend ports: - "5173:80" depends_on: backend: condition: service_healthy restart: unless-stopped