Skip to content
This repository has been archived by the owner on Nov 10, 2021. It is now read-only.

⚡️ Use multi-stage build for production #28

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Dockerfile.production
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
FROM node:10
FROM node:10 AS dependencies

WORKDIR /usr/src/app

COPY package.json package-lock.json /usr/src/app/

RUN npm install

COPY . /usr/src/app

RUN npm run build

FROM node:10-slim AS release

WORKDIR /usr/src/app

COPY --from=dependencies /usr/src/app .

CMD ["npm", "start"]