chore: use cache for pip

This commit is contained in:
2025-10-07 08:09:42 +02:00
parent eb6da3d9cf
commit edefce9703
+5 -7
View File
@@ -4,17 +4,15 @@ FROM python:3.13-slim AS builder
# Set working directory # Set working directory
WORKDIR /app WORKDIR /app
# # Install system dependencies # Create and set pip cache directory
# RUN apt-get update && apt-get install -y \ ENV PIP_CACHE_DIR=/root/.cache/pip
# build-essential \
# curl \
# && rm -rf /var/lib/apt/lists/*
# Copy requirements file # Copy requirements file
COPY requirements.txt . COPY requirements.txt .
# Install Python dependencies # Install Python dependencies with bind-mounted cache
RUN pip install --no-cache-dir --no-deps \ RUN --mount=type=cache,id=pip,target=/root/.cache/pip \
pip install --no-deps \
--disable-pip-version-check \ --disable-pip-version-check \
--target=/app/site-packages \ --target=/app/site-packages \
-r requirements.txt -r requirements.txt