diff --git a/docker/production/dockerfile b/docker/production/dockerfile index e52f8d4..55597e7 100644 --- a/docker/production/dockerfile +++ b/docker/production/dockerfile @@ -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 diff --git a/docker/production/scripts/2-initialise.sh b/docker/production/scripts/2-initialise.sh index 710e110..c01277e 100644 --- a/docker/production/scripts/2-initialise.sh +++ b/docker/production/scripts/2-initialise.sh @@ -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 \ No newline at end of file