Merge pull request #16 from gurucomputing/chore_add-port-environment-variable

added custom port option
This commit is contained in:
routerino 2022-08-02 17:16:47 +10:00 committed by GitHub
commit f8b6afc26d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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