fix starting of apache

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-07-13 15:18:32 +02:00
parent b1b96a5d8c
commit 8bf8e3f562
4 changed files with 6 additions and 10 deletions

View file

@ -22,9 +22,6 @@ RUN set -ex; \
\
mkdir -p /mnt/data; \
chown -R www-data:www-data /mnt/data; \
mkdir /caddy; \
chown -R 777 /caddy; \
chown -R www-data:www-data /caddy; \
chown -R 777 /tmp; \
\
apk add --no-cache \

View file

@ -35,18 +35,18 @@ if [ "$APACHE_PORT" != '443' ]; then
else
CADDYFILE="$(sed 's|auto_https.*|auto_https disable_redirects|' /Caddyfile)"
fi
echo "$CADDYFILE" > /caddy/Caddyfile
echo "$CADDYFILE" > /tmp/Caddyfile
# Change the trusted_proxies in case of reverse proxies
if [ "$APACHE_PORT" != '443' ]; then
CADDYFILE="$(sed 's|# trusted_proxies placeholder|trusted_proxies static private_ranges|' /caddy/Caddyfile)"
CADDYFILE="$(sed 's|# trusted_proxies placeholder|trusted_proxies static private_ranges|' /tmp/Caddyfile)"
else
CADDYFILE="$(sed 's|trusted_proxies.*private_ranges|# trusted_proxies placeholder|' /caddy/Caddyfile)"
CADDYFILE="$(sed 's|trusted_proxies.*private_ranges|# trusted_proxies placeholder|' /tmp/Caddyfile)"
fi
echo "$CADDYFILE" > /caddy/Caddyfile
echo "$CADDYFILE" > /tmp/Caddyfile
# Fix the Caddyfile format
caddy fmt --overwrite /caddy/Caddyfile
caddy fmt --overwrite /tmp/Caddyfile
# Add caddy path
mkdir -p /mnt/data/caddy/

View file

@ -20,4 +20,4 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=/usr/bin/caddy run --config /caddy/Caddyfile
command=/usr/bin/caddy run --config /tmp/Caddyfile

View file

@ -61,7 +61,6 @@
"/var/log/supervisord",
"/var/run/supervisord",
"/usr/local/apache2/logs",
"/caddy",
"/tmp"
]
},