This commit is contained in:
2023-04-16 21:38:32 +08:00
parent a0849e40ef
commit 0b6c876a0f
59 changed files with 1026 additions and 189 deletions

View File

@@ -39,8 +39,8 @@ function Quit {
}
function ChangeOwner {
Print Change file owner ...
chown nginx.root /var/log/nginx/
Print Changing file owner ...
chown nginx:root /var/log/nginx/
}
function SideCar {
@@ -59,18 +59,19 @@ function SideCar {
&& [ "$md5" != "$last_md5" ] \
&& last_md5=$md5 \
&& nginx -tq \
&& Print Reload nginx conf ... \
&& Print Reloading nginx conf ... \
&& nginx -s reload
done
}
function StartProc {
Print Start nginx ...
Print Starting nginx ...
nginx -g "$GLOBAL_DIRECTIVES" &
PIDS="$PIDS $!"
Print Start nginx sidecar ...
Print Starting nginx sidecar ...
SideCar &
PIDS="$PIDS $!"
Print Nginx started.
}
function Main {

View File

@@ -8,10 +8,13 @@ RUN apk update \
-e '1a\\n# Added by Dockerfile' \
-e '1adaemon off;' \
-e '1apid /run/nginx/nginx.pid;' \
-e '/^user /,/^worker_processes /d' \
-e '/^#include /s/^#//' \
-e '1aworker_rlimit_nofile 65535;' \
-e '/^user /s/^/#/' \
-e '/^worker_processes /s/^/#/' \
-e '/worker_connections/s/[0-9]\+/10240/' \
/etc/nginx/nginx.conf \
&& rm -rf /var/cache/apk/* /etc/nginx/http.d/* \
&& chown nginx.nginx /run/nginx
&& chown nginx:nginx /run/nginx \
&& chmod 0755 /var/lib/nginx \
&& rm -rf /var/cache/apk/* /etc/nginx/http.d/*
CMD ["/opt/ccmd"]