pip multi-stage to detect errors

This commit is contained in:
Gamosoft 2026-07-10 09:52:18 +02:00
parent 64aa99f791
commit 70436142a0
1 changed files with 5 additions and 5 deletions

View File

@ -37,11 +37,11 @@ WORKDIR /app
# Install Python packages # Install Python packages
COPY requirements.txt . COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \ RUN pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir --prefix=/install -r requirements.txt && \ RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
# Clean up unnecessary files to reduce image size # Clean up unnecessary files to reduce image size (failures here are non-fatal)
find /install -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && \ RUN find /install -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && \
find /install -type f -name "*.pyc" -delete && \ find /install -type f -name "*.pyc" -delete 2>/dev/null || true && \
find /install -type d -name "tests" -exec rm -rf {} + 2>/dev/null || true && \ find /install -type d -name "tests" -exec rm -rf {} + 2>/dev/null || true && \
find /install -type d -name "*.dist-info" -exec rm -rf {}/RECORD {} + 2>/dev/null || true find /install -type d -name "*.dist-info" -exec rm -rf {}/RECORD {} + 2>/dev/null || true