diff --git a/docker-compose.yml b/docker-compose.yml index fafdfcb..f8b3ad1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -100,6 +100,10 @@ services: # 服务配置 - BACKEND_HOST=0.0.0.0 - BACKEND_PORT=8000 + # 上传文件目录(持久化) + - UPLOAD_DIR=/app/uploads + volumes: + - backend-uploads:/app/uploads depends_on: postgres: condition: service_healthy @@ -115,11 +119,11 @@ services: networks: - it-desk-internal healthcheck: - test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"] - interval: 15s - timeout: 5s + test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health').read()"] + interval: 30s + timeout: 10s retries: 3 - start_period: 30s + start_period: 40s logging: driver: "json-file" options: @@ -173,3 +177,5 @@ volumes: name: wecom_it_postgres_data redis_data: name: wecom_it_redis_data + backend-uploads: + name: wecom_it_backend_uploads