fix: add .dockerignore to prevent Kaniko vite-temp snapshot failures #231

Merged
forgejo_admin merged 1 commit from 227-fix-vite-temp-dockerignore into main 2026-04-07 00:18:34 +00:00
Contributor

Summary

Adds a .dockerignore file to exclude Vite's volatile node_modules/.vite-temp/ directory from the Docker build context. These temp files are created during npm ci but disappear before Kaniko's COPY . . snapshot, causing build failures.

Changes

  • .dockerignore (new): Excludes node_modules/.vite-temp, .git, .env*, .DS_Store, and *.md from the build context

Test Plan

  • npm run build succeeds locally
  • Kaniko Docker builds should no longer fail with lstat .../node_modules/.vite-temp/... errors

Review Checklist

  • Change is minimal and scoped to the fix
  • No existing functionality affected
  • Build verified locally

N/A — one-liner infrastructure fix, no docs impact.

## Summary Adds a `.dockerignore` file to exclude Vite's volatile `node_modules/.vite-temp/` directory from the Docker build context. These temp files are created during `npm ci` but disappear before Kaniko's `COPY . .` snapshot, causing build failures. ## Changes - `.dockerignore` (new): Excludes `node_modules/.vite-temp`, `.git`, `.env*`, `.DS_Store`, and `*.md` from the build context ## Test Plan - [x] `npm run build` succeeds locally - Kaniko Docker builds should no longer fail with `lstat .../node_modules/.vite-temp/...` errors ## Review Checklist - [x] Change is minimal and scoped to the fix - [x] No existing functionality affected - [x] Build verified locally ## Related - Closes #227 ## Related Notes N/A — one-liner infrastructure fix, no docs impact.
fix: add .dockerignore to prevent Kaniko vite-temp snapshot failures
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
555cc1ee6e
Vite creates volatile temp files in node_modules/.vite-temp/ during
npm ci that can disappear before Kaniko's COPY snapshot, crashing
the Docker build.

Closes #227

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Contributor

PR #231 Review

DOMAIN REVIEW

Tech stack: SvelteKit (adapter-static) / Vite / Docker (Kaniko) / Woodpecker CI

This PR adds a new .dockerignore file to address Kaniko snapshot failures caused by volatile node_modules/.vite-temp files that are created during npm ci and disappear before COPY runs.

Analysis of .dockerignore contents:

node_modules/.vite-temp    # Primary fix -- correct target
.git                       # Standard -- saves ~50MB+ from build context
.gitignore                 # Fine
.env*                      # Good -- prevents secrets leaking into images
.DS_Store                  # Fine
*.md                       # Fine for production image

Dockerfile interaction: The Dockerfile does COPY package*.json ./ then RUN npm ci then COPY . .. The .dockerignore correctly prevents the volatile .vite-temp directory from being included in the build context sent to Kaniko. Since npm ci runs inside the container and creates its own node_modules, ignoring node_modules/.vite-temp from the host context is the right fix.

BLOCKERS

None.

NITS

  1. Missing node_modules top-level ignore. Only node_modules/.vite-temp is ignored, but the entire node_modules/ directory could be in .dockerignore since the Dockerfile runs npm ci inside the container. This would reduce build context size significantly and is standard Docker practice. Not a blocker -- outside the scope of this fix.

  2. *.md excludes README.md from build context. Fine since the Dockerfile builds a static SvelteKit app served by nginx.

SOP COMPLIANCE

  • Branch named after issue: 227-fix-vite-temp-dockerignore
  • Commit message is descriptive: fix: add .dockerignore to prevent Kaniko vite-temp snapshot failures
  • No secrets committed
  • No unnecessary file changes -- single file, tightly scoped
  • Single commit, clean history

VERDICT: APPROVED

Clean, minimal, well-scoped fix. The .dockerignore correctly targets the volatile node_modules/.vite-temp path that causes Kaniko snapshot failures. No blockers.

## PR #231 Review ### DOMAIN REVIEW **Tech stack:** SvelteKit (adapter-static) / Vite / Docker (Kaniko) / Woodpecker CI This PR adds a new `.dockerignore` file to address Kaniko snapshot failures caused by volatile `node_modules/.vite-temp` files that are created during `npm ci` and disappear before `COPY` runs. **Analysis of `.dockerignore` contents:** ``` node_modules/.vite-temp # Primary fix -- correct target .git # Standard -- saves ~50MB+ from build context .gitignore # Fine .env* # Good -- prevents secrets leaking into images .DS_Store # Fine *.md # Fine for production image ``` **Dockerfile interaction:** The Dockerfile does `COPY package*.json ./` then `RUN npm ci` then `COPY . .`. The `.dockerignore` correctly prevents the volatile `.vite-temp` directory from being included in the build context sent to Kaniko. Since `npm ci` runs inside the container and creates its own `node_modules`, ignoring `node_modules/.vite-temp` from the host context is the right fix. ### BLOCKERS None. ### NITS 1. **Missing `node_modules` top-level ignore.** Only `node_modules/.vite-temp` is ignored, but the entire `node_modules/` directory could be in `.dockerignore` since the Dockerfile runs `npm ci` inside the container. This would reduce build context size significantly and is standard Docker practice. Not a blocker -- outside the scope of this fix. 2. **`*.md` excludes README.md from build context.** Fine since the Dockerfile builds a static SvelteKit app served by nginx. ### SOP COMPLIANCE - [x] Branch named after issue: `227-fix-vite-temp-dockerignore` - [x] Commit message is descriptive: `fix: add .dockerignore to prevent Kaniko vite-temp snapshot failures` - [x] No secrets committed - [x] No unnecessary file changes -- single file, tightly scoped - [x] Single commit, clean history ### VERDICT: APPROVED Clean, minimal, well-scoped fix. The `.dockerignore` correctly targets the volatile `node_modules/.vite-temp` path that causes Kaniko snapshot failures. No blockers.
forgejo_admin deleted branch 227-fix-vite-temp-dockerignore 2026-04-07 00:18:34 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/westside-app!231
No description provided.