Update to rootless nginx.

This commit is contained in:
2024-09-06 02:11:20 -07:00
parent 17b7098bcc
commit 7f08d3b380
3 changed files with 8 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
worker_processes 4; worker_processes 4;
pid /run/nginx.pid; pid /tmp/nginx.pid;
error_log /dev/stderr info; error_log /dev/stderr info;

View File

@@ -2,7 +2,7 @@
nodaemon=true nodaemon=true
logfile=/dev/null logfile=/dev/null
logfile_maxbytes=0 logfile_maxbytes=0
pidfile=/run/supervisord.pid pidfile=/tmp/supervisord.pid
[program:nginx] [program:nginx]

View File

@@ -4,12 +4,17 @@
## Used by automation. Can be built manually for testing. ## Used by automation. Can be built manually for testing.
## ##
#### ####
FROM alpine:3.17 FROM alpine:3.20
RUN apk add nginx supervisor RUN apk add nginx supervisor
RUN mkdir -p /var/www RUN mkdir -p /var/www
RUN rm -rf /etc/nginx RUN rm -rf /etc/nginx
COPY build /var/www/build COPY build /var/www/build
COPY .conf/nginx /etc/nginx COPY .conf/nginx /etc/nginx
COPY .conf/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY .conf/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN chown -R nobody /var/www
RUN chown -R nobody /etc/nginx
RUN chown -R nobody /var/www/build
RUN chown -R nobody /etc/supervisor/conf.d/
USER nobody
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
EXPOSE 80 EXPOSE 80