Skip to content

Instantly share code, notes, and snippets.

@MikeMichel
Created December 8, 2017 11:38
Show Gist options
  • Save MikeMichel/73b6ed531d0ba9b43409c5f4a49b8b1b to your computer and use it in GitHub Desktop.
Save MikeMichel/73b6ed531d0ba9b43409c5f4a49b8b1b to your computer and use it in GitHub Desktop.
FROM node:8-alpine as builder
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm install --only=production --silent
COPY public public/
COPY src src/
COPY scripts scripts/
COPY config config/
# RUN npm run build
RUN yarn build
## 2nd stage
FROM nginx:1.13.6-alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /usr/src/app/build /usr/share/nginx/html/
COPY --from=builder /usr/src/app/build/index.html /usr/share/nginx/index-template.html
COPY nginx-entrypoint.sh /
ENTRYPOINT ["sh", "/nginx-entrypoint.sh"]
CMD ["nginx"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment