Guest User

Untitled

a guest
Dec 15th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. # => Build container
  2. FROM node:alpine as builder
  3. WORKDIR /app
  4. COPY package.json .
  5. COPY yarn.lock .
  6. RUN yarn
  7. COPY . .
  8. RUN yarn build
  9.  
  10. # => Run container
  11. FROM nginx:1.15.2-alpine
  12.  
  13. # Nginx config
  14. RUN rm -rf /etc/nginx/conf.d
  15. COPY conf /etc/nginx
  16.  
  17. # Static build
  18. COPY --from=builder /app/build /usr/share/nginx/html/
  19.  
  20. # Default port exposure
  21. EXPOSE 80
  22.  
  23. # Initialize environment variables into filesystem
  24. WORKDIR /usr/share/nginx/html
  25. COPY ./env.sh .
  26. COPY .env .
  27.  
  28. # Add bash
  29. RUN apk add --no-cache bash
  30.  
  31. # Run script which initializes env vars to fs
  32. RUN chmod +x env.sh
  33. # RUN ./env.sh
  34.  
  35. # Start Nginx server
  36. CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]
Add Comment
Please, Sign In to add comment