Created
March 26, 2020 22:23
-
-
Save gavinminami/41f547e84d70233f14939cea0ca2b9b5 to your computer and use it in GitHub Desktop.
Sample multi-stage 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:13.10.1 as builder | |
| RUN mkdir -p /usr/src/app | |
| WORKDIR /usr/src/app | |
| COPY package.json \ | |
| package-lock.json \ | |
| tsconfig.json \ | |
| /usr/src/app/ | |
| COPY src \ | |
| /usr/src/app/src | |
| RUN ls -R /usr/src/app | |
| RUN npm install | |
| RUN npm run prepare | |
| RUN ls -R /usr/src/app/lib | |
| FROM node:13.10.1 | |
| WORKDIR /usr/src/app | |
| COPY package.json \ | |
| package-lock.json \ | |
| tsconfig.json \ | |
| /usr/src/app/ | |
| COPY public \ | |
| /usr/src/app/public | |
| COPY --from=builder /usr/src/app/lib \ | |
| /usr/src/app/lib | |
| RUN ls /usr/src/app | |
| RUN npm install --production | |
| EXPOSE 3000 | |
| CMD [ "npm", "start" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment