Skip to content

Instantly share code, notes, and snippets.

@arcezd
Created June 24, 2020 23:44
Show Gist options
  • Save arcezd/6f1f6d54d2c20d151df976adbe10bf78 to your computer and use it in GitHub Desktop.
Save arcezd/6f1f6d54d2c20d151df976adbe10bf78 to your computer and use it in GitHub Desktop.
Dockerfile Typescript
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