Files
H3ConuMS-v2/docker-compose.yml
T
v6ole a5ac25a01d refactor: 合并 celery-beat 到 celery-worker (4→3容器)
celery-worker 加 -B 参数启动嵌入式 Beat,省去独立 celery-beat 容器。
定时任务由代码中 beat_schedule 驱动,schedule 文件保持持久化。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 14:45:48 +08:00

43 lines
1.0 KiB
YAML

services:
backend:
build: ./backend
ports:
- "8000:8000"
env_file:
- ./backend/.env
volumes:
- ./backend/logs:/app/logs
restart: unless-stopped
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 15s
timeout: 10s
retries: 5
start_period: 40s
celery-worker:
build: ./backend
command: celery -A celery_worker.celery_app worker -B --loglevel=info -Q h3c_onu_ms --schedule=/tmp/celerybeat-schedule
env_file:
- ./backend/.env
volumes:
- ./backend/logs:/app/logs
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
frontend:
build: ./frontend
ports:
- "18002:80"
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:80/health"]
interval: 15s
timeout: 10s
retries: 5