| 123456789101112131415161718192021222324252627282930 |
- # 标注平台后端 Docker Compose 配置
- version: '3.8'
- services:
- backend:
- build:
- context: .
- dockerfile: Dockerfile
- container_name: lq-label-backend
- ports:
- - "8000:8000"
- volumes:
- # 持久化数据库文件
- - ./data:/app/data
- # 挂载配置文件(可选,方便修改配置)
- - ./config.yaml:/app/config.yaml:ro
- environment:
- - DATABASE_PATH=/app/data/annotation_platform.db
- restart: unless-stopped
- healthcheck:
- test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
- interval: 30s
- timeout: 10s
- retries: 3
- start_period: 10s
- # 数据卷定义
- volumes:
- backend-data:
- driver: local
|