Skip to content

Commit

Permalink
fix starting of apache
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Jul 13, 2023
1 parent b1b96a5 commit 8bf8e3f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
3 changes: 0 additions & 3 deletions Containers/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
10 changes: 5 additions & 5 deletions Containers/apache/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion Containers/apache/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion php/containers.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"/var/log/supervisord",
"/var/run/supervisord",
"/usr/local/apache2/logs",
"/caddy",
"/tmp"
]
},
Expand Down

0 comments on commit 8bf8e3f

Please sign in to comment.