| 12345678910111213141516171819202122232425262728293031323334353637 |
- # 标注平台后端 Docker Compose 配置
- version: '3.8'
- services:
- backend:
- build:
- context: .
- dockerfile: Dockerfile
- container_name: lq-label-backend
- ports:
- - "8003:8000"
- volumes:
- # 持久化数据库文件
- - ./data:/app/data
- # 挂载配置文件(可选,方便修改配置)
- - ./config.yaml:/app/config.yaml:ro
- environment:
- - APP_ENV=prod
- - 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
- networks:
- - lq_network
- networks:
- lq_network:
- external: true
- # 数据卷定义
- volumes:
- backend-data:
- driver: local
|