From cf995fc35c93749eba6c1a233e718c2f5113c345 Mon Sep 17 00:00:00 2001 From: Taye Adeyemi Date: Sun, 2 Feb 2020 17:22:18 +0100 Subject: [PATCH] Use PORT_{TRUSTED,SANDBOX,PUBLIC} env vars in docker-entrypoint.sh --- README.md | 9 ++++++--- docker-entrypoint.sh | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2601f3f1..f5e4b515 100644 --- a/README.md +++ b/README.md @@ -210,9 +210,12 @@ variables (e.g. `URL_BASE_TRUSTED=https://mailtrain.domain.com (and more env-var | Parameter | Description | | --------- | ----------- | -| URL_BASE_TRUSTED | sets the trusted url of the instance (default: http://localhost:3000) | -| URL_BASE_SANDBOX | sets the sandbox url of the instance (default: http://localhost:3003) | -| URL_BASE_PUBLIC | sets the public url of the instance (default: http://localhost:3004) | +| PORT_TRUSTED | sets the trusted port of the instance (default: 3000) | +| PORT_SANDBOX | sets the sandbox port of the instance (default: 3003) | +| PORT_PUBLIC | sets the public port of the instance (default: 3004) | +| URL_BASE_TRUSTED | sets the trusted url of the instance (default: http://localhost) | +| URL_BASE_SANDBOX | sets the sandbox url of the instance (default: http://localhost) | +| URL_BASE_PUBLIC | sets the public url of the instance (default: http://localhost) | | WWW_HOST | sets the address that the server binds to (default: 0.0.0.0) | | WWW_PROXY | use if Mailtrain is behind an http reverse proxy (default: false) | | WWW_SECRET | sets the secret for the express session (default: `$(pwgen -1)`) | diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 2c33576a..1e815b89 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -5,9 +5,12 @@ set -e default_filter="(|(username={{username}})(mail={{username}}))" -URL_BASE_TRUSTED=${URL_BASE_TRUSTED:-'http://localhost:3000'} -URL_BASE_SANDBOX=${URL_BASE_SANDBOX:-'http://localhost:3003'} -URL_BASE_PUBLIC=${URL_BASE_PUBLIC:-'http://localhost:3004'} +URL_BASE_TRUSTED=${URL_BASE_TRUSTED:-'http://localhost'} +URL_BASE_SANDBOX=${URL_BASE_SANDBOX:-'http://localhost'} +URL_BASE_PUBLIC=${URL_BASE_PUBLIC:-'http://localhost'} +PORT_TRUSTED=${PORT_TRUSTED:-'3000'} +PORT_SANDBOX=${PORT_SANDBOX:-'3003'} +PORT_PUBLIC=${PORT_PUBLIC:-'3004'} WWW_HOST=${WWW_HOST:-'0.0.0.0'} WWW_PROXY=${WWW_PROXY:-'false'} WWW_SECRET=${WWW_SECRET:-$(pwgen -1)} @@ -50,9 +53,12 @@ www: host: $WWW_HOST proxy: $WWW_PROXY secret: $WWW_SECRET - trustedUrlBase: $URL_BASE_TRUSTED - sandboxUrlBase: $URL_BASE_SANDBOX - publicUrlBase: $URL_BASE_PUBLIC + trustedPort: $PORT_TRUSTED + sandboxPort: $PORT_SANDBOX + publicPort: $PORT_PUBLIC + trustedUrlBase: $URL_BASE_TRUSTED:${PORT_TRUSTED} + sandboxUrlBase: $URL_BASE_SANDBOX:${PORT_SANDBOX} + publicUrlBase: $URL_BASE_PUBLIC:${PORT_PUBLIC} mysql: host: $MYSQL_HOST