diff --git a/deploy/docker-entrypoint.sh b/deploy/docker-entrypoint.sh index 472d156..34e1952 100644 --- a/deploy/docker-entrypoint.sh +++ b/deploy/docker-entrypoint.sh @@ -1,13 +1,8 @@ #!/bin/sh set -e -# Ensure SERVER_NAME is set -if [ -z "$SERVER_NAME" ]; then - echo "[entrypoint] SERVER_NAME is not set. Using default value: localhost" - SERVER_NAME="localhost" -else - echo "[entrypoint] Using SERVER_NAME=$SERVER_NAME" -fi +SERVER_NAME="${SERVER_NAME:-$(hostname -f 2>/dev/null || hostname)}" +export SERVER_NAME # Render vhost ONLY into http.d so it's inside http{} context if [ -f /etc/nginx/templates/default.conf.template ]; then