# 钢琴练习方案系统 - Docker Compose # 部署命令: docker-compose up -d --build # 停止命令: docker-compose down services: piano-plan: build: context: . dockerfile: Dockerfile image: piano-plan:latest container_name: piano-plan ports: - "127.0.0.1:5000:5000" volumes: # 数据持久化 - 容器重启不丢失 - ./data:/app/data # SQLite数据库 - ./output:/app/output # 生成的PDF文件 - ./config:/app/config # API配置文件 environment: - FLASK_ENV=production restart: unless-stopped # 数据目录说明: # - ./data: SQLite数据库 (piano_plans.db) # - ./output: 导出的PDF文件 # - ./config: API配置 (api_config.json) # # 备份只需备份这三个目录即可 # # 更新系统: # 1. 拉取新代码 # 2. docker-compose build --no-cache # 3. docker-compose up -d # 4. 数据目录内容不会被覆盖