Dockerfile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 python3 certbot jq \
  16. && python3 -m ensurepip \
  17. && rm -rf /var/cache/apk/*
  18. ENV NPM_BUILD_VERSION="${BUILD_VERSION}" NPM_BUILD_COMMIT="${BUILD_COMMIT}" NPM_BUILD_DATE="${BUILD_DATE}"
  19. # s6 overlay
  20. COPY scripts/install-s6 /tmp/install-s6
  21. RUN /tmp/install-s6 "${TARGETPLATFORM}" && rm -f /tmp/install-s6
  22. EXPOSE 80
  23. EXPOSE 81
  24. EXPOSE 443
  25. COPY docker/rootfs /
  26. ADD backend /app
  27. ADD frontend/dist /app/frontend
  28. COPY global /app/global
  29. WORKDIR /app
  30. RUN yarn install
  31. # Remove frontend service not required for prod, dev nginx config as well
  32. RUN rm -rf /etc/services.d/frontend RUN rm -f /etc/nginx/conf.d/dev.conf
  33. VOLUME [ "/data", "/etc/letsencrypt" ]
  34. CMD [ "/init" ]
  35. HEALTHCHECK --interval=5s --timeout=3s CMD /bin/check-health