Remove dev-dependencies from the final build

This commit is contained in:
Alan Grainger
2024-11-01 08:55:54 +01:00
parent 6d34cdaf88
commit ea5cb3acb8
3 changed files with 17 additions and 6 deletions
+5 -2
View File
@@ -2,11 +2,14 @@ FROM node:lts-slim
WORKDIR /app
COPY package*.json ./
COPY package.json ./
RUN npm install --omit=dev
COPY . .
RUN npm run build
# Build without type checking, as we have removed the Typescript
# dev-dependencies above to save space in the final build
RUN npx tsc --noCheck
CMD [ "node", "dist/index.js" ]