|
@@ -2,9 +2,12 @@
|
|
|
FROM python:3.11-slim AS builder
|
|
FROM python:3.11-slim AS builder
|
|
|
|
|
|
|
|
WORKDIR /build
|
|
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 .
|
|
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
|
|
FROM python:3.11-slim
|
|
@@ -14,8 +17,8 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
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 app/ app/
|
|
|
COPY data/ data/
|
|
COPY data/ data/
|