Dockerfile 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. FROM --platform=$TARGETPLATFORM uozi/nginx-ui-base:latest
  2. ARG TARGETOS
  3. ARG TARGETARCH
  4. ARG TARGETVARIANT
  5. EXPOSE 80 443
  6. # init config
  7. COPY resources/docker/init-config.up /etc/s6-overlay/s6-rc.d/init-config/up
  8. COPY resources/docker/init-config.sh /etc/s6-overlay/s6-rc.d/init-config/init-config.sh
  9. RUN chmod +x /etc/s6-overlay/s6-rc.d/init-config/init-config.sh && \
  10. echo 'oneshot' > /etc/s6-overlay/s6-rc.d/init-config/type && \
  11. touch /etc/s6-overlay/s6-rc.d/user/contents.d/init-config && \
  12. mkdir -p /etc/s6-overlay/s6-rc.d/nginx/dependencies.d && \
  13. touch /etc/s6-overlay/s6-rc.d/nginx/dependencies.d/init-config
  14. # register nginx-ui service
  15. COPY resources/docker/nginx-ui.run /etc/s6-overlay/s6-rc.d/nginx-ui/run
  16. RUN echo 'longrun' > /etc/s6-overlay/s6-rc.d/nginx-ui/type && \
  17. touch /etc/s6-overlay/s6-rc.d/user/contents.d/nginx-ui
  18. # copy nginx config
  19. COPY resources/docker/nginx.conf /usr/etc/nginx/nginx.conf
  20. COPY resources/docker/nginx-ui.conf /usr/etc/nginx/conf.d/nginx-ui.conf
  21. COPY resources/docker/nginx-ui.conf /etc/nginx/conf.d/nginx-ui.conf
  22. # copy nginx-ui executable binary
  23. COPY nginx-ui-$TARGETOS-$TARGETARCH$TARGETVARIANT/nginx-ui /usr/local/bin/nginx-ui
  24. # remove default nginx config
  25. RUN rm -f /etc/nginx/conf.d/default.conf \
  26. && rm -f /usr/etc/nginx/conf.d/default.conf