We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2e78a1 commit 1fde0adCopy full SHA for 1fde0ad
root/etc/cont-init.d/50-config
@@ -56,8 +56,9 @@ if ! grep -Fxq "APP_KEY=${key}" /config/www/.env; then
56
sed -i "s#^APP_KEY=.*#APP_KEY=${key}#" /config/www/.env
57
fi
58
59
-# if DB_HOST contains a port
60
-if echo "${DB_HOST}" | grep -qP '^(?:[0-9.]+|(?:\[[0-9a-fA-F:]+\]))(:[0-9]+)$'; then
+# if DB_HOST contains a port and DB_HOST is not a IPv6 without brackets [..]
+# support ipv4:port, [ipv6]:port, and domain:port
61
+if echo "$DB_HOST" | grep -qE ':[0-9]+$' && ! echo "$DB_HOST" | grep -qE '^(:{0,2}[a-fA-F0-9]{1,4})+$'; then
62
DB_HOST_PORT="${DB_HOST}"
63
64
0 commit comments