From 752295a67570d4571de6403d715ed7e24028bb66 Mon Sep 17 00:00:00 2001 From: db1234719 Date: Tue, 18 Nov 2025 09:57:03 +0330 Subject: [PATCH] added some modules to the nginx and added made group command too along one tzdata package to be installed at ready stage --- Dockerfile | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b56c0b..1ab85a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,25 +24,46 @@ RUN ./configure \ --pid-path=/var/run/nginx.pid \ --lock-path=/var/run/nginx.lock \ --with-http_ssl_module \ - --with-http_v2_module \ + --with-http_realip_module \ + --with-http_addition_module \ + --with-http_sub_module \ + --with-http_dav_module \ + --with-http_flv_module \ + --with-http_mp4_module \ + --with-http_gunzip_module \ --with-http_gzip_static_module \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_stub_status_module \ + --with-http_auth_request_module \ + --with-mail \ + --with-mail_ssl_module \ + --with-file-aio \ + --with-threads \ --with-stream \ --with-stream_ssl_module \ - --with-mail \ - --with-mail_ssl_module + --with-stream_realip_module \ + --with-http_slice_module \ + --with-http_v2_module RUN make -j$(nproc) RUN make install +RUN rm -rf /tmp/* +RUN rm -rf /var/cache/apk/* # --- Stage 2: Runtime --- FROM alpine:3.22 # Runtime dependencies RUN apk add \ - pcre2 zlib openssl ca-certificates libcap curl -RUN adduser -D -g 'nginx' nginx + pcre2 zlib openssl ca-certificates tzdata libcap curl git +RUN addgroup -S nginx +RUN adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx RUN mkdir -p /var/cache/nginx /etc/nginx/conf.d /etc/nginx/stream_conf.d /usr/share/nginx/html /var/run RUN chown -R nginx:nginx /var/cache/nginx /var/run /etc/nginx /usr/share/nginx/html +# Copy dummy html +COPY index.html /var/www/html/index.html + # Copy Nginx from builder COPY --from=builder /usr/sbin/nginx /usr/sbin/nginx COPY --from=builder /etc/nginx /etc/nginx