Created
January 28, 2020 01:49
-
-
Save ziazon/06925d91d7bff3e9960a5eb0cb322ccb to your computer and use it in GitHub Desktop.
my node.js Dockerfile
This file contains hidden or 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 build | |
WORKDIR /app | |
COPY ./package-lock.json ./package.json ./ | |
RUN npm ci | |
COPY . . | |
ENV NODE_ENV=production | |
RUN npm run build | |
FROM node:lts-alpine as serve | |
WORKDIR /app | |
COPY --from=build /app/dist /app/dist | |
COPY ./package-lock.json ./package.json ./ | |
ENV NODE_ENV=production | |
RUN npm install --only=prod | |
EXPOSE 8080 | |
CMD ["node", "dist/server.js"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment