Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre authored Dec 6, 2023
2 parents 9e59d8d + 547443f commit 205447b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ ARG CONFIG="\
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/run/nginx/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
Expand Down Expand Up @@ -174,6 +174,7 @@ RUN \

RUN \
echo "Building nginx ..." \
&& mkdir -p /var/run/nginx/ \
&& cd /usr/src/nginx-$NGINX_VERSION \
&& ./auto/configure $CONFIG \
--with-cc-opt="-I../boringssl/include" \
Expand Down Expand Up @@ -214,6 +215,7 @@ ARG NGINX_GROUP_GID
ENV NGINX_VERSION $NGINX_VERSION
ENV NGINX_COMMIT $NGINX_COMMIT

COPY --from=base /var/run/nginx/ /var/run/nginx/
COPY --from=base /tmp/runDeps.txt /tmp/runDeps.txt
COPY --from=base /etc/nginx /etc/nginx
COPY --from=base /usr/lib/nginx/modules/*.so /usr/lib/nginx/modules/
Expand Down Expand Up @@ -253,9 +255,11 @@ EXPOSE 8080 8443

STOPSIGNAL SIGTERM

# prepare to switching to non-root - update file permissions
RUN chown --verbose nginx:nginx \
/var/run/nginx.pid
# prepare to switching to non-root - update file permissions of directory containing
# nginx.lock and nginx.pid file
RUN \
chown -R --verbose nginx:nginx \
/var/run/nginx/

USER nginx
CMD ["nginx", "-g", "daemon off;"]
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include /etc/nginx/main.d/*.conf;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
pid /var/run/nginx/nginx.pid;

events {
worker_connections 1024;
Expand Down

0 comments on commit 205447b

Please sign in to comment.