Skip to content

fix(docker): dev frontend installs from the lockfile with npm ci (#4435) - #4436

Merged
vybe merged 1 commit into
devfrom
feature/4435-frontend-npm-ci
Nov 11, 2026
Merged

vybe merged 1 commit into
devfrom
feature/4435-frontend-npm-ci

Conversation

@obasilakis

Copy link
Copy Markdown
Contributor

Summary

  • docker/frontend/Dockerfile runs npm ci from the committed lockfile. It no longer deletes package-lock.json.
  • src/frontend/Dockerfile is removed. Nothing builds it, and it ran npm install with no lockfile.
  • New guard tests/unit/test_4435_dockerfile_npm_ci.py fails when a tracked Dockerfile installs project dependencies with npm install / npm i / npm add or deletes a lockfile. npm install -g is exempt. Matches only at command position, so echo "... npm install ..." text in docker/base-image/Dockerfile does not trip it.

The January lockfile deletion worked around a missing rollup linux binary. Vite 8 uses rolldown and no longer installs rollup; the lockfile carries musl bindings for x64 and arm64 (rolldown, lightningcss).

Test Plan

  • cd tests && pytest unit/test_4435_dockerfile_npm_ci.py -v: 15 passed. Red on dev for docker/frontend/Dockerfile and src/frontend/Dockerfile.
  • docker buildx build --no-cache --platform linux/arm64 and linux/amd64 of docker/frontend/Dockerfile, from a macOS arm64 host: both build on first try.
  • In each image: npx vite build succeeds (native bindings load); node_modules/.package-lock.json vs package-lock.json: 0 of 422 (arm64) / 0 of 421 (amd64) versions differ.
  • Linux x64 host build (CI or teammate).

Existing dev stacks keep the old tree in the anonymous /app/node_modules volume. To pick this up: docker compose build --no-cache frontend && docker compose up -d --no-deps --force-recreate -V frontend.

Fixes #4435

🤖 Generated with Claude Code

docker/frontend/Dockerfile deleted package-lock.json and ran npm install,
so every dev-stack build floated the whole dependency tree to the newest
registry versions. It now runs npm ci, matching Dockerfile.prod.

The lockfile carries the musl bindings for x64 and arm64 (rolldown,
lightningcss); vite 8 no longer installs rollup. Built on linux/arm64 and
linux/amd64 from a macOS arm64 host: vite build succeeds and 0 installed
versions differ from package-lock.json.

src/frontend/Dockerfile is removed: nothing builds it and it ran npm
install with no lockfile.

tests/unit/test_4435_dockerfile_npm_ci.py fails when a tracked Dockerfile
installs project dependencies with npm install or deletes a lockfile.
Global tool installs (npm install -g) are exempt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@obasilakis obasilakis added the ui PR touches the frontend UI — triggers Playwright e2e tests label Nov 10, 2026
@obasilakis
obasilakis marked this pull request as draft November 10, 2026 09:40
@obasilakis
obasilakis marked this pull request as ready for review November 10, 2026 09:44
@obasilakis

Copy link
Copy Markdown
Contributor Author

Ran the dev frontend from this branch with the compose settings (bind-mounted src/frontend, anonymous /app/node_modules, cap_drop: ALL, DOCKER_ENV=true), image built with --no-cache via npm ci, lockfile kept:

  • Vite 8.3.5 dev server ready in 785 ms, 0 errors in logs.
  • 200 for /, /src/main.js, /src/App.vue, /src/style.css (Tailwind) and the optimized deps (vue, vue-router, pinia, axios).
  • /api/* proxy to backend:8000 returns 200, tested against a stub backend.

@vybe
vybe merged commit af3b050 into dev Nov 11, 2026
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants