fix(docker): remove default nginx configs

Delete the packaged nginx config files after installing nginx so the
image uses the application-provided configuration.
This commit is contained in:
Andras Bacsai 2026-05-16 20:09:25 +02:00
parent 0917bb7b8e
commit 6ceb444cf4
2 changed files with 3 additions and 0 deletions

View file

@ -41,6 +41,7 @@ RUN set -eux; \
grep -qxF "@nginx ${NGINX_REPOSITORY}" /etc/apk/repositories || echo "@nginx ${NGINX_REPOSITORY}" >> /etc/apk/repositories; \
curl -fsSL https://nginx.org/keys/nginx_signing.rsa.pub -o /etc/apk/keys/nginx_signing.rsa.pub; \
apk add --no-cache --upgrade "nginx@nginx=${NGINX_VERSION}"; \
rm -f /etc/nginx/nginx.conf /etc/nginx/conf.d/default.conf; \
nginx -v
RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID && \

View file

@ -32,6 +32,7 @@ RUN set -eux; \
grep -qxF "@nginx ${NGINX_REPOSITORY}" /etc/apk/repositories || echo "@nginx ${NGINX_REPOSITORY}" >> /etc/apk/repositories; \
curl -fsSL https://nginx.org/keys/nginx_signing.rsa.pub -o /etc/apk/keys/nginx_signing.rsa.pub; \
apk add --no-cache --upgrade "nginx@nginx=${NGINX_VERSION}"; \
rm -f /etc/nginx/nginx.conf /etc/nginx/conf.d/default.conf; \
nginx -v
ARG USER_ID
@ -90,6 +91,7 @@ RUN set -eux; \
grep -qxF "@nginx ${NGINX_REPOSITORY}" /etc/apk/repositories || echo "@nginx ${NGINX_REPOSITORY}" >> /etc/apk/repositories; \
curl -fsSL https://nginx.org/keys/nginx_signing.rsa.pub -o /etc/apk/keys/nginx_signing.rsa.pub; \
apk add --no-cache --upgrade "nginx@nginx=${NGINX_VERSION}"; \
rm -f /etc/nginx/nginx.conf /etc/nginx/conf.d/default.conf; \
nginx -v
RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID && \