Skip to content

Instantly share code, notes, and snippets.

@yv84
Forked from anonymous/Dockerfile
Last active January 18, 2019 05:40
Show Gist options
  • Save yv84/a00104ea58ff0190b65a8452846e3876 to your computer and use it in GitHub Desktop.
Save yv84/a00104ea58ff0190b65a8452846e3876 to your computer and use it in GitHub Desktop.
# https://medium.com/@shakyShane/lets-talk-about-docker-artifacts-27454560384f
# Stage 1 - the build process
FROM node:7.10 as build-deps
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn
COPY . ./
RUN yarn build
# Stage 2 - the production environment
FROM nginx:1.12-alpine
COPY --from=build-deps /usr/src/app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment