1
0
Fork 0
mirror of https://github.com/nginx-proxy/nginx-proxy synced 2024-04-27 04:15:26 +02:00

feat: use nginx image builtin entrypoint

This commit is contained in:
Nicolas Duchon 2023-12-25 18:37:43 +01:00
parent 4a8aa5db67
commit 952087befc
4 changed files with 5 additions and 7 deletions

View File

@ -21,7 +21,7 @@ RUN apk add --no-cache --virtual .run-deps \
&& update-ca-certificates
# Configure Nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
RUN sed -i 's/\[ "\$1" = "nginx" \]/\[ "\$1" = "forego" \] || \[ "\$1" = "nginx" \]/' /docker-entrypoint.sh \
&& sed -i 's/worker_processes 1/worker_processes auto/' /etc/nginx/nginx.conf \
&& sed -i 's/worker_connections 1024/worker_connections 10240/' /etc/nginx/nginx.conf \
&& mkdir -p '/etc/nginx/dhparam'
@ -31,9 +31,9 @@ COPY --from=forego /usr/local/bin/forego /usr/local/bin/forego
COPY --from=docker-gen /usr/local/bin/docker-gen /usr/local/bin/docker-gen
COPY network_internal.conf /etc/nginx/
COPY app/40-nginx-proxy.sh /docker-entrypoint.d/
COPY app nginx.tmpl LICENSE /app/
WORKDIR /app/
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["forego", "start", "-r"]

View File

@ -20,7 +20,7 @@ RUN apt-get update \
&& rm -r /var/lib/apt/lists/*
# Configure Nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
RUN sed -i 's/\[ "\$1" = "nginx" \]/\[ "\$1" = "forego" \] || \[ "\$1" = "nginx" \]/' /docker-entrypoint.sh \
&& sed -i 's/worker_processes 1/worker_processes auto/' /etc/nginx/nginx.conf \
&& sed -i 's/worker_connections 1024/worker_connections 10240/' /etc/nginx/nginx.conf \
&& mkdir -p '/etc/nginx/dhparam'
@ -30,9 +30,9 @@ COPY --from=forego /usr/local/bin/forego /usr/local/bin/forego
COPY --from=docker-gen /usr/local/bin/docker-gen /usr/local/bin/docker-gen
COPY network_internal.conf /etc/nginx/
COPY app/40-nginx-proxy.sh /docker-entrypoint.d/
COPY app nginx.tmpl LICENSE /app/
WORKDIR /app/
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["forego", "start", "-r"]

View File

@ -117,5 +117,3 @@ if [[ $* == 'forego start -r' ]]; then
EOT
fi
fi
exec "$@"

View File

@ -1,2 +1,2 @@
dockergen: docker-gen -watch -notify "nginx -s reload" /app/nginx.tmpl /etc/nginx/conf.d/default.conf
nginx: nginx
nginx: nginx -g "daemon off;"