Dockerfile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Stage 0, "build-stage", based on Node.js, to build and compile the frontend
  2. FROM node:19 as build-stage
  3. # Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
  4. # Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
  5. # installs, work.
  6. RUN apt-get update && apt-get install -y wget --no-install-recommends \
  7. && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
  8. && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
  9. && apt-get update \
  10. && apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
  11. --no-install-recommends \
  12. && rm -rf /var/lib/apt/lists/* \
  13. && apt-get purge --auto-remove -y curl \
  14. && rm -rf /src/*.deb
  15. WORKDIR /app
  16. RUN npm install puppeteer
  17. COPY package*.json /app/
  18. RUN npm install
  19. COPY ./ /app/
  20. ARG FRONTEND_ENV=production
  21. ENV VUE_APP_ENV=${FRONTEND_ENV}
  22. # Comment out the next line to disable tests
  23. #RUN npm run test:unit
  24. RUN npm run build
  25. # Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
  26. FROM nginx:1.23
  27. COPY --from=build-stage /app/dist/ /usr/share/nginx/html
  28. COPY --from=build-stage /app/googlee455ea492ff4b8ca.html /usr/share/nginx/html/googlee455ea492ff4b8ca.html
  29. COPY --from=build-stage /app/nginx.conf /etc/nginx/conf.d/default.conf
  30. COPY --from=build-stage /app/nginx-backend-not-found.conf /etc/nginx/extra-conf.d/backend-not-found.conf