mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
enhance(docker): recreate access.log and error.log as regular files
This commit is contained in:
parent
45a68112b1
commit
abc73bbf77
4 changed files with 8 additions and 27 deletions
21
Dockerfile
21
Dockerfile
|
@ -4,25 +4,14 @@ ARG TARGETARCH
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT
|
||||||
EXPOSE 80 443
|
EXPOSE 80 443
|
||||||
|
|
||||||
# init config
|
|
||||||
COPY resources/docker/init-config.up /etc/s6-overlay/s6-rc.d/init-config/up
|
|
||||||
COPY resources/docker/init-config.sh /etc/s6-overlay/s6-rc.d/init-config/init-config.sh
|
|
||||||
|
|
||||||
RUN chmod +x /etc/s6-overlay/s6-rc.d/init-config/init-config.sh && \
|
|
||||||
echo 'oneshot' > /etc/s6-overlay/s6-rc.d/init-config/type && \
|
|
||||||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/init-config && \
|
|
||||||
mkdir -p /etc/s6-overlay/s6-rc.d/nginx/dependencies.d && \
|
|
||||||
touch /etc/s6-overlay/s6-rc.d/nginx/dependencies.d/init-config
|
|
||||||
|
|
||||||
# register nginx-ui service
|
# register nginx-ui service
|
||||||
COPY resources/docker/nginx-ui.run /etc/s6-overlay/s6-rc.d/nginx-ui/run
|
COPY resources/docker/nginx-ui.run /etc/s6-overlay/s6-rc.d/nginx-ui/run
|
||||||
RUN echo 'longrun' > /etc/s6-overlay/s6-rc.d/nginx-ui/type && \
|
RUN echo 'longrun' > /etc/s6-overlay/s6-rc.d/nginx-ui/type && \
|
||||||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/nginx-ui
|
touch /etc/s6-overlay/s6-rc.d/user/contents.d/nginx-ui
|
||||||
|
|
||||||
# copy nginx config
|
# copy nginx config
|
||||||
COPY resources/docker/nginx.conf /usr/etc/nginx/nginx.conf
|
COPY resources/docker/nginx.conf /usr/local/etc/nginx/nginx.conf
|
||||||
COPY resources/docker/nginx-ui.conf /usr/etc/nginx/conf.d/nginx-ui.conf
|
COPY resources/docker/nginx-ui.conf /usr/local/etc/nginx/conf.d/nginx-ui.conf
|
||||||
COPY resources/docker/nginx-ui.conf /etc/nginx/conf.d/nginx-ui.conf
|
|
||||||
|
|
||||||
# copy nginx-ui executable binary
|
# copy nginx-ui executable binary
|
||||||
COPY nginx-ui-$TARGETOS-$TARGETARCH$TARGETVARIANT/nginx-ui /usr/local/bin/nginx-ui
|
COPY nginx-ui-$TARGETOS-$TARGETARCH$TARGETVARIANT/nginx-ui /usr/local/bin/nginx-ui
|
||||||
|
@ -30,3 +19,9 @@ COPY nginx-ui-$TARGETOS-$TARGETARCH$TARGETVARIANT/nginx-ui /usr/local/bin/nginx-
|
||||||
# remove default nginx config
|
# remove default nginx config
|
||||||
RUN rm -f /etc/nginx/conf.d/default.conf \
|
RUN rm -f /etc/nginx/conf.d/default.conf \
|
||||||
&& rm -f /usr/etc/nginx/conf.d/default.conf
|
&& rm -f /usr/etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
# recreate access.log and error.log
|
||||||
|
RUN rm -f /var/log/nginx/access.log && \
|
||||||
|
touch /var/log/nginx/access.log && \
|
||||||
|
rm -f /var/log/nginx/error.log && \
|
||||||
|
touch /var/log/nginx/error.log
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# the up and down files are special: they're not shell scripts,
|
|
||||||
# but single command lines interpreted by execlineb.
|
|
||||||
# You should not have to worry about execline;
|
|
||||||
# you should only remember that an up file contains a single command line.
|
|
||||||
|
|
||||||
if [ "$(ls -A /etc/nginx)" = "" ]; then
|
|
||||||
echo "[INFO] Initialing Nginx configurations directory"
|
|
||||||
cp -rp /usr/etc/nginx/* /etc/nginx/
|
|
||||||
echo "[INFO] Nginx configurations directory initialed"
|
|
||||||
fi
|
|
|
@ -1 +0,0 @@
|
||||||
/etc/s6-overlay/s6-rc.d/init-config/init-config.sh
|
|
|
@ -22,7 +22,6 @@ http {
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log main;
|
access_log /var/log/nginx/access.log main;
|
||||||
access_log /var/log/nginx/access.local.log main;
|
|
||||||
|
|
||||||
sendfile on;
|
sendfile on;
|
||||||
#tcp_nopush on;
|
#tcp_nopush on;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue