fix: Use npm install to regenerate package-lock.json and bypass corruption

- Delete package-lock.json in Docker build to avoid corrupted string_decoder entry
- Use npm install instead of npm ci to regenerate package-lock.json fresh
- This avoids the 'string_decoder is a core module' error that package-lock.json had cached
This commit is contained in:
Muhammad Ibrahim
2025-10-28 16:31:52 +00:00
parent 212b24b1c8
commit a76c5b8963
+2 -2
View File
@@ -47,8 +47,8 @@ COPY --chown=node:node backend/ ./backend/
WORKDIR /app/backend
RUN npm cache clean --force &&\
rm -rf node_modules ~/.npm /root/.npm &&\
npm ci --ignore-scripts --legacy-peer-deps --no-audit --prefer-online --fetch-retries=0 &&\
rm -rf node_modules ~/.npm /root/.npm package-lock.json &&\
npm install --omit=dev --ignore-scripts --legacy-peer-deps --no-audit --prefer-online --fetch-retries=0 &&\
npm run db:generate &&\
npm prune --omit=dev &&\
npm cache clean --force