Skip to content

Instantly share code, notes, and snippets.

@inductor
Last active May 12, 2019 01:46
Show Gist options
  • Save inductor/a9840e9e289312e9ea33e01a6aceb663 to your computer and use it in GitHub Desktop.
Save inductor/a9840e9e289312e9ea33e01a6aceb663 to your computer and use it in GitHub Desktop.
Dockerfile
FROM node:10.15.3 as builder
WORKDIR /src
COPY . .
RUN yarn install \
--prefer-offline \
--frozen-lockfile \
--non-interactive \
--production=false
RUN yarn build
RUN rm -rf node_modules && \
NODE_ENV=production yarn install \
--prefer-offline \
--pure-lockfile \
--non-interactive \
--production=true
FROM node:10.15.3-alpine
WORKDIR /src
COPY --from=builder /src .
ENV HOST 0.0.0.0
EXPOSE 3000
CMD [ "yarn", "start" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment