refactor: restructure config to simplify volume mounts
This commit is contained in:
parent
708cce23d0
commit
8d13f07455
|
@ -16,26 +16,24 @@ RUN addgroup -g 101 -S nginx && \
|
|||
apk --update add --virtual .build-deps curl && \
|
||||
apk --update --no-cache add nginx ca-certificates && \
|
||||
apk --no-cache upgrade libcrypto3 libssl3 && \
|
||||
apk del .build-deps && \
|
||||
rm -rf /var/www && \
|
||||
rm -rf /etc/nginx/conf.d && \
|
||||
touch /run/nginx.pid && \
|
||||
chown nginx /run/nginx.pid && \
|
||||
chown -R nginx /var/log/nginx && \
|
||||
mkdir -p /var/cache/nginx && \
|
||||
chown -R nginx /var/cache/nginx && \
|
||||
chmod -R 750 /var/cache/nginx && \
|
||||
chown -R nginx:nginx /var/lib/nginx/html && \
|
||||
chmod -R 750 /var/lib/nginx/html && \
|
||||
apk del .build-deps && \
|
||||
rm -rf /var/cache/apk/* && \
|
||||
rm -rf /tmp/*
|
||||
|
||||
ADD overlay/ /
|
||||
|
||||
RUN mkdir -p /var/tmp/nginx /var/cache/nginx && \
|
||||
chown -R nginx /var/tmp/nginx /var/cache/nginx && \
|
||||
chown -R nginx:nginx /var/lib/nginx/html && \
|
||||
chown -R root:nginx /etc/nginx /etc/nginx/conf.d && \
|
||||
chmod -R 640 /etc/nginx /etc/nginx/conf.d && \
|
||||
chmod 750 /var/lib/nginx/html /var/cache/nginx /etc/nginx /etc/nginx/conf.d
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
WORKDIR /var/lib/nginx/html
|
||||
USER 101
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
worker_processes 1;
|
||||
pid /var/run/nginx.pid;
|
||||
pid /var/tmp/nginx/nginx.pid;
|
||||
error_log stderr error;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
server_tokens off;
|
||||
access_log off;
|
||||
error_log /dev/stderr;
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
server_tokens off;
|
||||
access_log off;
|
||||
|
||||
fastcgi_buffers 16 16k;
|
||||
fastcgi_buffer_size 32k;
|
||||
|
||||
include /etc/nginx/vhost.conf;
|
||||
include /etc/nginx/conf.d/vhosts.conf;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user