Last active
August 23, 2022 09:11
-
-
Save yacinebenkaidali/06d29255d147fec80dd7fd17f6995b96 to your computer and use it in GitHub Desktop.
Multi stage bulid of a Typescript based nodejs app.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:alpine as builder | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . | |
# npm run build runs the tsc transpiler | |
RUN npm run build | |
FROM node:alpine as prod | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm ci --only=production | |
COPY --from=builder /usr/src/app/dist ./dist | |
CMD ["node", "dist"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment