fix: various minor bugs

This commit is contained in:
Strix 2023-10-20 02:43:56 +02:00
parent 7d9241c000
commit db4f5eca5f
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
5 changed files with 11 additions and 6 deletions

View file

@ -9,4 +9,5 @@ COPY conf.d /etc/nginx
COPY nginx.conf /etc/nginx/nginx.conf
COPY entrypoint.sh /entrypoint
ENTRYPOINT [ "sh", "/entrypoint" ]
ENTRYPOINT [ "sh", "/entrypoint" ]
CMD [ "nginx", "-g", "daemon off;" ]

View file

@ -18,6 +18,8 @@ server {
listen 443 ssl;
server_name localhost;
# SSL will be managed by certbot, no need to insert SSL config.
location / {
proxy_pass http://$host$request_uri;
}

View file

@ -3,6 +3,7 @@
trap exit TERM
if [ -n "${CERTBOT_DOMAINS}" ]; then
sleep 5
echo "registering domains..."
certbot --nginx -n --agree-tos \
@ -12,11 +13,10 @@ if [ -n "${CERTBOT_DOMAINS}" ]; then
while :; do
echo "renewing domains..."
certbot --nginx -n renew
nginx -s reload
sleep 12h & wait $!
done &
else
echo "skipping certbot due to no domains!"
fi
fi &
exec nginx -g "daemon off;"
exec "$@"