diff --git a/backend/auth/Dockerfile b/backend/auth/Dockerfile index bb1c6d0..a785d62 100644 --- a/backend/auth/Dockerfile +++ b/backend/auth/Dockerfile @@ -2,13 +2,16 @@ FROM python:3.13-slim WORKDIR /home/booksystem/auth +# 先复制依赖文件并安装,充分利用 Docker 构建缓存 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ -COPY . . - +# 复制 swagger-ui 静态文件(不常变化) COPY swagger-ui /home/booksystem/swagger-ui +# 最后复制应用代码(经常变化) +COPY . . + EXPOSE 8000 -CMD ["python", "main.py"] +CMD ["python", "main.py"] \ No newline at end of file