Skip to content

Instantly share code, notes, and snippets.

@d-exclaimation
Created October 12, 2022 21:45
Node.js Typescript (Yarn) Dockerfile
FROM node:18-alpine as builder
WORKDIR /build
COPY . .
RUN yarn install
RUN rm -rf dist/
RUN tsc
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
COPY yarn.lock ./
COPY --from=builder ./build/dist ./dist
RUN yarn install --production
CMD yarn start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment