diff --git a/Dockerfile b/Dockerfile index 5a55c07..af6b503 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,12 +7,14 @@ RUN apk update && apk upgrade && \ # Download and build the latest version of Nginx from source WORKDIR /tmp -RUN wget https://nginx.org/download/nginx-1.25.3.tar.gz -RUN tar -xzvf nginx-1.25.3.tar.gz -WORKDIR /tmp/nginx-1.25.3 -RUN ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/etc/nginx/nginx.conf -RUN make -RUN make install +RUN wget https://nginx.org/download/nginx-1.25.3.tar.gz && \ + tar -xzvf nginx-1.25.3.tar.gz && \ + cd nginx-1.25.3 && \ + ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/etc/nginx/nginx.conf && \ + make > /dev/null 2>&1 && \ + make install > /dev/null 2>&1 && \ + make_status=$? && \ + if [ $make_status -ne 0 ]; then echo "Nginx build failed"; exit $make_status; fi # Cleanup unnecessary files RUN rm -rf /tmp/*