Explorar o código

chore(langgraph): update Dockerfile

Xiaogang Liao hai 3 meses
pai
achega
8b5861bf73
Modificáronse 1 ficheiros con 7 adicións e 4 borrados
  1. 7 4
      cfc-langgraph/Dockerfile

+ 7 - 4
cfc-langgraph/Dockerfile

@@ -2,9 +2,12 @@
 FROM python:3.11-slim AS builder
 
 WORKDIR /build
+RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends gcc g++ python3-dev && rm -rf /var/lib/apt/lists/*
+
 COPY pyproject.toml .
-RUN pip install --no-cache-dir -e . && \
-    pip install --no-cache-dir gunicorn
+RUN pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip && \
+    pip download --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -d /wheels -e . && \
+    pip download --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -d /wheels gunicorn
 
 # ── 运行阶段 ──
 FROM python:3.11-slim
@@ -14,8 +17,8 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 
 WORKDIR /app
 
-COPY --from=builder /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/
-COPY --from=builder /usr/local/bin/ /usr/local/bin/
+COPY --from=builder /wheels /wheels
+RUN pip install --no-cache-dir --find-links /wheels cfc-langgraph gunicorn && rm -rf /wheels
 
 COPY app/ app/
 COPY data/ data/