Skip to content

Instantly share code, notes, and snippets.

@teitei-tk
Created July 28, 2020 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teitei-tk/5bd9dd7e8422bbd3583c9fca411e2f9c to your computer and use it in GitHub Desktop.
Save teitei-tk/5bd9dd7e8422bbd3583c9fca411e2f9c to your computer and use it in GitHub Desktop.
Next.js with Docker multi stage build
FROM node:12.18.2-alpine as builder
WORKDIR /app
COPY package.json .
COPY yarn.lock .
COPY tsconfig.json .
RUN yarn install --production
FROM node:12.18.2-alpine
COPY --from=builder /app/node_modules /app/node_modules
COPY . .
EXPOSE 3000
CMD [ "yarn", "dev" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment