added custom port option

This commit is contained in:
Christopher Bisset 2022-08-02 17:16:06 +10:00
parent 00ece42a88
commit 09da09bea6
2 changed files with 8 additions and 0 deletions

View file

@ -30,6 +30,8 @@ FROM alpine:latest
ENV PROJECT_NAME="headscale-ui"
# URL for the github/git location
ENV PROJECT_URL="https://github.com/gurucomputing/headscale-ui"
# Port that caddy will run on
ENV PORT="443"
# Production Web Server port. Runs a self signed SSL certificate
EXPOSE 443

View file

@ -12,5 +12,11 @@ then
cp /staging/Caddyfile /data/Caddyfile
fi
# replace port in Caddyfile if set
if [ "$PORT" != "443" ]
then
sed -i "s/:443/$PORT/g" /data/Caddyfile
fi
echo "Starting Caddy"
/usr/sbin/caddy run --adapter caddyfile --config /data/Caddyfile