perf: optimize docker build with pnpm cache mounts and less aggressive pruning
Some checks failed
Build & Deploy / 🔍 Prepare Environment (push) Successful in 7s
Build & Deploy / 🏗️ Build (push) Failing after 1m5s
Build & Deploy / 🧪 QA (push) Successful in 3m46s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / ⚡ PageSpeed (push) Has been skipped
Build & Deploy / 🔔 Notifications (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare Environment (push) Successful in 7s
Build & Deploy / 🏗️ Build (push) Failing after 1m5s
Build & Deploy / 🧪 QA (push) Successful in 3m46s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / ⚡ PageSpeed (push) Has been skipped
Build & Deploy / 🔔 Notifications (push) Successful in 2s
This commit is contained in:
@@ -44,7 +44,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
docker image prune -f || true
|
||||
docker builder prune -f --filter "until=24h" || true
|
||||
docker builder prune -f --filter "until=168h" || true
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
12
Dockerfile
12
Dockerfile
@@ -20,12 +20,18 @@ ENV SENTRY_SUPPRESS_TURBOPACK_WARNING=1
|
||||
# Enable pnpm
|
||||
RUN corepack enable
|
||||
|
||||
# Copy workspace configuration
|
||||
# Set pnpm home and store directory for caching
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN mkdir -p /pnpm/store
|
||||
|
||||
# Copy workspace configuration and manifests for better caching
|
||||
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc ./
|
||||
COPY apps/web/package.json ./apps/web/package.json
|
||||
|
||||
# Install dependencies (use cache mount if possible, but keep it simple as per standard)
|
||||
RUN pnpm install --no-frozen-lockfile
|
||||
# Install dependencies with cache mount
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
# Copy source
|
||||
COPY . .
|
||||
|
||||
Reference in New Issue
Block a user