Remove dev-dependencies from the final build
This commit is contained in:
+5
-2
@@ -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" ]
|
||||
|
||||
Reference in New Issue
Block a user