Created
June 24, 2020 23:44
-
-
Save arcezd/6f1f6d54d2c20d151df976adbe10bf78 to your computer and use it in GitHub Desktop.
Dockerfile Typescript
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:12-alpine AS builder | |
# Use build directory | |
WORKDIR /build | |
# Copy app files | |
COPY ./ /build/ | |
# Install node dependencies | |
RUN npm install | |
RUN npm run build | |
FROM node:12-alpine | |
# Use app directory | |
WORKDIR /app | |
# Copy app files | |
COPY package*.json /app/ | |
COPY --from=builder /build/dist ./dist | |
# Install node dependencies | |
RUN npm install --only=prod | |
# Start dist app | |
ENTRYPOINT ["npm", "run", "start:dist"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment