Created
December 6, 2019 11:50
-
-
Save fuglu/0dbfca1e0b827ba8470fb4ba26ac5d75 to your computer and use it in GitHub Desktop.
Basic Node.js Dockerfile
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:lts-alpine AS builder | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm ci | |
COPY . . | |
RUN npm run test | |
RUN npm run build | |
FROM node:lts-alpine | |
ENV NODE_ENV=production | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm ci --production | |
COPY --from=builder /usr/src/app/dist/ dist/ | |
USER node | |
EXPOSE 3000 | |
ENTRYPOINT ["node", "dist/index.js"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment