FROM debian:bookworm-slim RUN set -eux; \ # create nginx user/group first, to be consistent throughout docker variants groupadd --system --gid 101 nginx; \ useradd --system --gid nginx --no-create-home --home /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx; \ apt-get update; \ apt-get install -y nginx wget libnginx-mod-http-brotli-filter libnginx-mod-http-brotli-static; \ \ arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ url=; \ case "$arch" in \ 'amd64') \ url='https://code.thetadev.de/ThetaDev/ngx-awesomeindex/releases/download/v0.1.1/libnginx-mod-http-awesomeindex_0.1.1-1_amd64.deb'; \ ;; \ 'arm64') \ url='https://code.thetadev.de/ThetaDev/ngx-awesomeindex/releases/download/v0.1.1/libnginx-mod-http-awesomeindex_0.1.1-1_arm64.deb'; \ ;; \ *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ esac; \ \ wget -O "libnginx-mod-http-awesomeindex.deb" "$url"; \ apt-get install -y "./libnginx-mod-http-awesomeindex.deb"; \ apt-get remove -y wget; \ apt-get autoremove -y; \ apt-get clean; \ rm "libnginx-mod-http-awesomeindex.deb"; \ # forward request and error logs to docker log collector ln -sf /dev/stdout /var/log/nginx/access.log; \ ln -sf /dev/stderr /var/log/nginx/error.log; \ # create a docker-entrypoint.d directory mkdir /docker-entrypoint.d COPY docker-entrypoint.sh / COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d COPY 15-local-resolvers.sh /docker-entrypoint.d COPY 20-envsubst-on-templates.sh /docker-entrypoint.d COPY 30-tune-worker-processes.sh /docker-entrypoint.d ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 STOPSIGNAL SIGQUIT CMD ["nginx", "-g", "daemon off;"]