更新
This commit is contained in:
+3
-3
@@ -76,8 +76,8 @@ COPY ${VAR_PYFILE_PATH}/requirements.txt ./
|
||||
# --prefix=/install : 依赖会被装到 /install/lib/pythonX.Y/site-packages
|
||||
# uwsgi 单独安装(生产环境 WSGI 服务器)
|
||||
# ------------------------------------------------------------
|
||||
RUN pip3 install --prefix=/install -r requirements.txt && \
|
||||
pip3 install --prefix=/install uwsgi
|
||||
RUN python3 -m pip install --prefix=/usr/local/python3.12.8 -r requirements.txt && \
|
||||
python3 -m pip install --prefix=/usr/local/python3.12.8 uwsgi \
|
||||
|
||||
# ============================================================
|
||||
# 阶段二:runtime —— 只保留运行时内容
|
||||
@@ -144,7 +144,7 @@ RUN yum install -y net-tools openssl-devel bzip2-devel libffi-devel mysql-devel
|
||||
# /install 下的内容会被合并到 /usr/local
|
||||
# 这样 pip 安装的包就能被 runtime 阶段的 python 找到
|
||||
# ------------------------------------------------------------
|
||||
COPY --from=builder /install /usr/local
|
||||
COPY --from=builder /usr/local/python3.12.8 /usr/local/python3.12.8
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# 创建工作区
|
||||
|
||||
Reference in New Issue
Block a user