Dockerfile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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/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. S6_FIX_ATTRS_HIDDEN=1 \
  12. S6_BEHAVIOUR_IF_STAGE2_FAILS=1 \
  13. NODE_ENV=production \
  14. NPM_BUILD_VERSION="${BUILD_VERSION}" \
  15. NPM_BUILD_COMMIT="${BUILD_COMMIT}" \
  16. NPM_BUILD_DATE="${BUILD_DATE}"
  17. RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
  18. && apt-get update \
  19. && apt-get install -y certbot jq python3-pip \
  20. && apt-get clean \
  21. && rm -rf /var/lib/apt/lists/*
  22. # s6 overlay
  23. COPY scripts/install-s6 /tmp/install-s6
  24. RUN /tmp/install-s6 "${TARGETPLATFORM}" && rm -f /tmp/install-s6
  25. EXPOSE 80 81 443
  26. COPY backend /app
  27. COPY frontend/dist /app/frontend
  28. COPY global /app/global
  29. WORKDIR /app
  30. RUN yarn install
  31. # add late to limit cache-busting by modifications
  32. COPY docker/rootfs /
  33. # Remove frontend service not required for prod, dev nginx config as well
  34. RUN rm -rf /etc/services.d/frontend RUN rm -f /etc/nginx/conf.d/dev.conf
  35. VOLUME [ "/data", "/etc/letsencrypt" ]
  36. ENTRYPOINT [ "/init" ]
  37. HEALTHCHECK --interval=5s --timeout=3s CMD /bin/check-health
  38. LABEL org.label-schema.schema-version="1.0" \
  39. org.label-schema.license="MIT" \
  40. org.label-schema.name="nginx-proxy-manager" \
  41. org.label-schema.description="Docker container for managing Nginx proxy hosts with a simple, powerful interface " \
  42. org.label-schema.url="https://github.com/jc21/nginx-proxy-manager" \
  43. org.label-schema.vcs-url="https://github.com/jc21/nginx-proxy-manager.git" \
  44. org.label-schema.cmd="docker run --rm -ti jc21/nginx-proxy-manager:latest"