Created
November 20, 2024 00:59
-
-
Save stvhay/93bf002bb994020692e75c890059f850 to your computer and use it in GitHub Desktop.
nginx-extras dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:bookworm-slim | |
RUN set -x \ | |
# 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 upgrade -y \ | |
&& apt-get install --no-install-recommends --no-install-suggests -y \ | |
nginx-extras gettext-base curl \ | |
&& apt-get remove --purge --auto-remove -y && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx.list \ | |
# 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.envsh /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;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment