Commit 333a9b7d authored by Vũ Hoàng Anh's avatar Vũ Hoàng Anh

Standardize pip cache strategy: Use BuildKit cache mount for both stage and prod

- Both Dockerfile.stage and Dockerfile.prod now use --mount=type=cache
- Faster builds with BuildKit cache mount (temporary, per-build)
- Requires: docker buildx or DOCKER_BUILDKIT=1
parent 644d54dd
......@@ -9,8 +9,9 @@ WORKDIR /app
# Copy requirements.txt
COPY requirements.txt .
# Install dependencies to a local directory (with cache for speed)
RUN pip install --user -r requirements.txt
# Install dependencies to a local directory (with cache mount for speed)
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --user -r requirements.txt
# ============================================================
# Final stage - Production image (tối giản)
......
......@@ -15,7 +15,7 @@ ENV ENV=development
# Copy requirements.txt trước để tận dụng Docker cache
COPY requirements.txt .
# Cài đặt thư viện Python (Sử dụng cache mount để siêu nhanh)
# Cài đặt thư viện Python (với cache mount)
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r requirements.txt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment