update
Some checks failed
Backend EC - Modal Deployment / build-and-push (push) Failing after 8m19s
Backend EC - Modal Deployment / notify-deploy (push) Has been skipped

This commit is contained in:
DatTT127
2026-07-19 09:00:34 +07:00
parent 23e8242fc6
commit 2022990fc7

View File

@@ -24,7 +24,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Copy requirements first so this layer is cached unless deps change
COPY requirements.txt .
COPY backend /app/backend
# FIX: Create an isolated venv to compile wheels so Kaniko doesn't corrupt global pip vendor files
RUN python -m venv /opt/wheelhouse-env && \
/opt/wheelhouse-env/bin/pip install --no-cache-dir --upgrade pip && \
@@ -64,6 +64,7 @@ ENV PATH=/opt/venv/bin:$PATH
# Copy pre-built wheels from wheelhouse stage (platform-specific)
COPY --from=wheelhouse /wheels /wheels
COPY --from=wheelhouse /wheels/requirements.txt ./requirements.txt
COPY --from=wheelhouse /app/backend /app/backend
# Install dependencies FROM LOCAL WHEELS ONLY (no network access needed)
# --no-index: do not query PyPI or any external index
@@ -94,6 +95,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Step 3: Use the exact matching numeric IDs for --chown
COPY --from=builder --chown=999:999 /opt/venv /opt/venv
COPY --from=builder --chown=999:999 /app/backend /app/backend
ENV PATH=/opt/venv/bin:$PATH
# Copy application code