Dockerfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # This is a Dockerfile intended to be built using `docker buildx`
  2. # for multi-arch support. Building with `docker build` may have unexpected results.
  3. # This file assumes that the frontend has been built using ./scripts/frontend-build
  4. FROM --platform=${TARGETPLATFORM:-linux/amd64} jc21/alpine-nginx-full:node
  5. ARG TARGETPLATFORM
  6. ARG BUILDPLATFORM
  7. ARG BUILD_VERSION
  8. ARG BUILD_COMMIT
  9. ARG BUILD_DATE
  10. ENV SUPPRESS_NO_CONFIG_WARNING=1
  11. ENV S6_FIX_ATTRS_HIDDEN=1
  12. ENV NODE_ENV=production
  13. RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
  14. && apk update \
  15. && apk add python2 certbot jq \
  16. && rm -rf /var/cache/apk/*
  17. ENV NPM_BUILD_VERSION="${BUILD_VERSION}" NPM_BUILD_COMMIT="${BUILD_COMMIT}" NPM_BUILD_DATE="${BUILD_DATE}"
  18. # s6 overlay
  19. COPY scripts/install-s6 /tmp/install-s6
  20. RUN /tmp/install-s6 "${TARGETPLATFORM}" && rm -f /tmp/install-s6
  21. EXPOSE 80
  22. EXPOSE 81
  23. EXPOSE 443
  24. COPY docker/rootfs /
  25. ADD backend /app
  26. ADD frontend/dist /app/frontend
  27. WORKDIR /app
  28. RUN yarn install
  29. # Remove frontend service not required for prod, dev nginx config as well
  30. RUN rm -rf /etc/services.d/frontend RUN rm -f /etc/nginx/conf.d/dev.conf
  31. VOLUME [ "/data", "/etc/letsencrypt" ]
  32. CMD [ "/init" ]
  33. HEALTHCHECK --interval=5s --timeout=3s CMD /bin/check-health