Dockerfile 823 B

12345678910111213141516171819202122232425262728293031323334
  1. FROM ubuntu:18.04 as builder
  2. # Install any needed packages
  3. RUN apt-get update && apt-get install -y curl git gnupg
  4. # install nodejs
  5. RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
  6. RUN apt-get install -y nodejs
  7. WORKDIR /apps
  8. COPY . .
  9. RUN npm install yarn -g
  10. RUN yarn && NODE_ENV=production yarn build:www
  11. CMD ["ls", "-al", "build"]
  12. # ===========================================================
  13. FROM nginx:stable-alpine
  14. # The following is mainly for doc purpose to show which ENV is supported
  15. ENV WS_URL=
  16. WORKDIR /usr/share/nginx/html
  17. COPY env.sh .
  18. RUN apk add --no-cache bash; chmod +x env.sh
  19. COPY docker/nginx.conf /etc/nginx/nginx.conf
  20. COPY --from=builder /apps/packages/apps/build /usr/share/nginx/html
  21. EXPOSE 80
  22. CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]