Dockerfile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 jc21/nginx-full:certbot-node
  5. ARG TARGETPLATFORM
  6. ARG BUILD_VERSION
  7. ARG BUILD_COMMIT
  8. ARG BUILD_DATE
  9. # See: https://github.com/just-containers/s6-overlay/blob/master/README.md
  10. ENV SUPPRESS_NO_CONFIG_WARNING=1 \
  11. S6_BEHAVIOUR_IF_STAGE2_FAILS=1 \
  12. S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
  13. S6_FIX_ATTRS_HIDDEN=1 \
  14. S6_KILL_FINISH_MAXTIME=10000 \
  15. S6_VERBOSITY=1 \
  16. NODE_ENV=production \
  17. NPM_BUILD_VERSION="${BUILD_VERSION}" \
  18. NPM_BUILD_COMMIT="${BUILD_COMMIT}" \
  19. NPM_BUILD_DATE="${BUILD_DATE}"
  20. RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
  21. && apt-get update \
  22. && apt-get install -y --no-install-recommends jq logrotate \
  23. && apt-get clean \
  24. && rm -rf /var/lib/apt/lists/*
  25. # s6 overlay
  26. COPY docker/scripts/install-s6 /tmp/install-s6
  27. RUN /tmp/install-s6 "${TARGETPLATFORM}" && rm -f /tmp/install-s6
  28. EXPOSE 80 81 443
  29. COPY backend /app
  30. COPY frontend/dist /app/frontend
  31. COPY global /app/global
  32. WORKDIR /app
  33. RUN yarn install \
  34. && yarn cache clean
  35. # add late to limit cache-busting by modifications
  36. COPY docker/rootfs /
  37. # Remove frontend service not required for prod, dev nginx config as well
  38. RUN rm -rf /etc/s6-overlay/s6-rc.d/user/contents.d/frontend /etc/nginx/conf.d/dev.conf \
  39. && chmod 644 /etc/logrotate.d/nginx-proxy-manager \
  40. && pip uninstall --yes setuptools \
  41. && pip install --no-cache-dir "setuptools==58.0.0"
  42. VOLUME [ "/data", "/etc/letsencrypt" ]
  43. ENTRYPOINT [ "/init" ]
  44. LABEL org.label-schema.schema-version="1.0" \
  45. org.label-schema.license="MIT" \
  46. org.label-schema.name="nginx-proxy-manager" \
  47. org.label-schema.description="Docker container for managing Nginx proxy hosts with a simple, powerful interface " \
  48. org.label-schema.url="https://github.com/jc21/nginx-proxy-manager" \
  49. org.label-schema.vcs-url="https://github.com/jc21/nginx-proxy-manager.git" \
  50. org.label-schema.cmd="docker run --rm -ti jc21/nginx-proxy-manager:latest"