From bdd7c44dbec95bc0da240474b734adeb47477f2d Mon Sep 17 00:00:00 2001 From: Macky Date: Fri, 7 Aug 2026 19:27:36 +0700 Subject: [PATCH] fix(Dockerfile): build frontend without NODE_ENV=production (npm skips devDeps like vite -> 'vite: not found') Root cause of EasyPanel build failure: ENV NODE_ENV=production was set before 'npm install', so npm skipped devDependencies (vite, @vitejs/plugin-vue) and 'npm run build' had no vite. Fix: remove the early NODE_ENV=production (devDeps install for the build), use 'npm ci' (deterministic, falls back to npm install). NODE_ENV only matters for Flask runtime which is set at the CMD stage. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 878a9f9..7cc01d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,12 +8,12 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends nodejs \ && rm -rf /var/lib/apt/lists/* -ENV NODE_ENV=production WORKDIR /app -# 1) Build frontend +# 1) Build frontend (devDeps incl. vite are required to build; +# NODE_ENV must NOT be production yet or npm skips devDependencies) COPY frontend/package.json frontend/package-lock.json* ./frontend/ -RUN cd frontend && npm install +RUN cd frontend && npm ci || npm install COPY frontend/ ./frontend/ RUN cd frontend && npm run build