diff --git a/backend/Dockerfile b/backend/Dockerfile index fc3521f..be973f2 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,5 +1,5 @@ # 使用Python 3.9.6基础镜像 -FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/python:3.12.9-slim +FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/python:3.12-slim # 设置工作目录 WORKDIR /app @@ -18,7 +18,6 @@ COPY requirements.txt . # 安装系统依赖、Python依赖,然后清理(一个RUN命令减少层大小) RUN apt-get update && apt-get install -y \ gcc \ - wget \ default-libmysqlclient-dev \ pkg-config \ && pip install --index-url https://mirrors.aliyun.com/pypi/simple --no-cache-dir -r requirements.txt \ diff --git a/docker-compose.yml b/docker-compose.yml index 598937f..38d0d06 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -103,7 +103,7 @@ services: - ./data/uploads:/app/uploads - ./data/logs/backend:/app/logs healthcheck: - test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8000/health"] + test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 10s retries: 3