feat: Allow configuring app port using ROMM_PORT environment variable

By using the `ROMM_PORT` environment variable, users can now configure
the port on which the application listens, which defaults to `8080`.
This commit is contained in:
Michael Manganiello
2025-02-19 01:02:25 -03:00
parent f6be1a6df3
commit fbff92403f
2 changed files with 6 additions and 1 deletions

View File

@@ -33,6 +33,11 @@ for var_name in $(printenv | cut -d= -f1 | grep "_FILE$" || true); do
unset "${var_name}"
done
# Set default values for environment variables used by nginx templates.
# Nginx uses `envsubst` to load environment variables into configuration files, but it does not
# support the default value syntax `${VAR:-default}`.
: "${ROMM_PORT:=8080}"
# Replace environment variables used in nginx configuration templates.
/docker-entrypoint.d/20-envsubst-on-templates.sh >/dev/null

View File

@@ -4,7 +4,7 @@
server {
root /var/www/html;
listen 8080;
listen ${ROMM_PORT};
server_name localhost;
proxy_set_header Host $http_host;