Commit ff411655 authored by bin.gong's avatar bin.gong

Update Dockerfile

parent b8277862
# 多阶段构建:Python + Node.js 全栈应用 # 多阶段构建:Python + Node.js 全栈应用
FROM hb.eazytec-cloud.com/eazytec/eazydevelop-python-node:ubuntu22.04-python3.11-node22 AS python-base FROM hb.eazytec-cloud.com/eazytec/eazydevelop-python-node:ubuntu22.04-python3.12-node22 AS python-base
# 设置工作目录 # 设置工作目录
WORKDIR /app WORKDIR /app
...@@ -16,7 +16,7 @@ RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/ && ...@@ -16,7 +16,7 @@ RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/ &&
pip install --no-cache-dir -r backend/requirements.txt pip install --no-cache-dir -r backend/requirements.txt
# Node.js 阶段 # Node.js 阶段
FROM hb.eazytec-cloud.com/eazytec/eazydevelop-python-node:ubuntu22.04-python3.11-node22 AS node-base FROM hb.eazytec-cloud.com/eazytec/eazydevelop-python-node:ubuntu22.04-python3.12-node22 AS node-base
# 设置工作目录 # 设置工作目录
WORKDIR /app WORKDIR /app
...@@ -33,14 +33,14 @@ RUN cd frontend && npm config set registry https://registry.npmmirror.com && \ ...@@ -33,14 +33,14 @@ RUN cd frontend && npm config set registry https://registry.npmmirror.com && \
npm install --production npm install --production
# 最终阶段:合并两个服务 # 最终阶段:合并两个服务
FROM hb.eazytec-cloud.com/eazytec/eazydevelop-python-node:ubuntu22.04-python3.11-node22 FROM hb.eazytec-cloud.com/eazytec/eazydevelop-python-node:ubuntu22.04-python3.12-node22
# 设置工作目录 # 设置工作目录
WORKDIR /app WORKDIR /app
# 复制 Python 后端 # 复制 Python 后端
COPY --from=python-base /app/backend/ /app/backend/ COPY --from=python-base /app/backend/ /app/backend/
COPY --from=python-base /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/ COPY --from=python-base /usr/local/lib/python3.12/site-packages/ /usr/local/lib/python3.12/site-packages/
# 复制 Node.js 前端 # 复制 Node.js 前端
COPY --from=node-base /app/frontend/ /app/frontend/ COPY --from=node-base /app/frontend/ /app/frontend/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment