1.8 KiB
1.8 KiB
2026-08-07 — Docker build fix: 'vite: not found' on EasyPanel
Symptom
EasyPanel docker build failed at RUN cd frontend && npm run build with:
sh: 1: vite: not found (exit 127). Step 7/11 (frontend build).
Root cause
The Dockerfile set ENV NODE_ENV=production before RUN cd frontend && npm install.
With NODE_ENV=production, npm skips devDependencies — and vite + @vitejs/plugin-vue
are devDependencies. So npm run build had no vite binary → vite: not found.
Fix (commit bdd7c44)
- Removed the early
ENV NODE_ENV=production(must not be set before the frontend build). - Changed
npm install→npm ci(deterministic from committedfrontend/package-lock.json, falls back tonpm installif lockfile missing — it is committed, sonpm ciapplies). NODE_ENVfor the Flask runtime is not needed;FLASK_DEBUG=0is set at the CMD stage.
Verification (no local Docker)
npm cilocally: succeeds;vitepackage present undernode_modules/vite(Node 20/npm 10 in the image runs esbuild/vite postinstall scripts by default — noallowScriptsblocking).npm run build: succeeds (✓ built), producing freshfrontend/dist/.- This confirms the Docker npm-build path (devDeps installed → vite present) will now succeed.
Note on committed frontend source
The router now includes tabbed views (/my/board → MyBoard.vue, /training → Training.vue,
/settings → Settings.vue) and the app's Dashboard is admin-only with / → admin, trainees
redirect to /my/board. These views are already tracked and pushed; the Docker build ships them.
Remaining before live model
- Still needs a real
LLM_API_KEY(+ provider) inbackend/.envfor analyze/persona/chat. - Validate the Docker build on EasyPanel once re-deployed.