removed curl because of security risks and used busybox wget instead and combined some run commands into one with && as separator
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -45,19 +45,16 @@ RUN ./configure \
|
||||
--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/*
|
||||
RUN make && make install
|
||||
RUN rm -rf /tmp/* && rm -rf /var/cache/apk/*
|
||||
|
||||
# --- Stage 2: Runtime ---
|
||||
FROM alpine:3.22
|
||||
|
||||
# Runtime dependencies
|
||||
RUN apk add \
|
||||
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
|
||||
pcre2 zlib openssl ca-certificates tzdata libcap git
|
||||
RUN addgroup -S nginx && 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
|
||||
|
||||
@@ -93,4 +90,5 @@ STOPSIGNAL SIGTERM
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
# Healthcheck
|
||||
HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD curl -f http://127.0.0.1:80/ || exit 1
|
||||
HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD busybox wget --spider -q http://127.0.0.1:80/ || exit 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user