Skip to content

Commit a50dfe8

Browse files
authored
Fix DB customization via envvar (#75)
Since 1.5 version, the DB host config default value changed from "localhost" to "127.0.0.1" [1], so the replacement performed here didn't work anymore. [1] phpipam/phpipam@2fe6f9a
1 parent 1c00824 commit a50dfe8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ RUN cp ${WEB_REPO}/config.dist.php ${WEB_REPO}/config.php && \
6363
chown www-data /var/www/html/app/subnets/import-subnet/upload && \
6464
chown www-data /var/www/html/css/images/logo && \
6565
echo "\$db['webhost'] = '%';" >> ${WEB_REPO}/config.php && \
66-
sed -i -e "s/\['host'\] = 'localhost'/\['host'\] = getenv(\"MYSQL_ENV_MYSQL_HOST\") ?: \"mysql\"/" \
66+
sed -i -e "s/\['host'\] = '127.0.0.1'/\['host'\] = getenv(\"MYSQL_ENV_MYSQL_HOST\") ?: \"mysql\"/" \
6767
-e "s/\['user'\] = 'phpipam'/\['user'\] = getenv(\"MYSQL_ENV_MYSQL_USER\") ?: \"root\"/" \
6868
-e "s/\['name'\] = 'phpipam'/\['name'\] = getenv(\"MYSQL_ENV_MYSQL_DB\") ?: \"phpipam\"/" \
6969
-e "s/\['pass'\] = 'phpipamadmin'/\['pass'\] = getenv(\"MYSQL_ENV_MYSQL_ROOT_PASSWORD\")/" \

0 commit comments

Comments
 (0)