Dockerfile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. && rm -rf /etc/nginx \
  15. && apk update \
  16. && apk add python2 certbot jq \
  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. WORKDIR /app
  29. RUN yarn install
  30. # Remove frontend service not required for prod, dev nginx config as well
  31. RUN rm -rf /etc/services.d/frontend RUN rm -f /etc/nginx/conf.d/dev.conf
  32. VOLUME [ "/data", "/etc/letsencrypt" ]
  33. CMD [ "/init" ]
  34. HEALTHCHECK --interval=5s --timeout=3s CMD /bin/check-health