Guest User

Untitled

a guest
Jul 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. # The builder from node image
  2. FROM node:alpine as builder
  3.  
  4. # build-time variables
  5. # prod|sandbox its value will be come from outside
  6. ARG env=prod
  7.  
  8. RUN apk update && apk add --no-cache make git
  9.  
  10. # Move our files into directory name "app"
  11. WORKDIR /app
  12. COPY package.json package-lock.json /app/
  13. RUN cd /app && npm install
  14. COPY . /app
  15.  
  16. # Build with $env variable from outside
  17. RUN cd /app && npm run build:$env
  18.  
  19. # Build a small nginx image with static website
  20. FROM nginx:alpine
  21. RUN rm -rf /usr/share/nginx/html/*
  22. COPY nginx.conf /etc/nginx/nginx.conf
  23. COPY --from=builder /app/dist /usr/share/nginx/html
  24. EXPOSE 80
  25. CMD ["nginx", "-g", "daemon off;"]
Add Comment
Please, Sign In to add comment