Skip to content

Commit

Permalink
Fix DB customization via envvar (#75)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Arderos authored Aug 25, 2022
1 parent 1c00824 commit a50dfe8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ RUN cp ${WEB_REPO}/config.dist.php ${WEB_REPO}/config.php && \
chown www-data /var/www/html/app/subnets/import-subnet/upload && \
chown www-data /var/www/html/css/images/logo && \
echo "\$db['webhost'] = '%';" >> ${WEB_REPO}/config.php && \
sed -i -e "s/\['host'\] = 'localhost'/\['host'\] = getenv(\"MYSQL_ENV_MYSQL_HOST\") ?: \"mysql\"/" \
sed -i -e "s/\['host'\] = '127.0.0.1'/\['host'\] = getenv(\"MYSQL_ENV_MYSQL_HOST\") ?: \"mysql\"/" \
-e "s/\['user'\] = 'phpipam'/\['user'\] = getenv(\"MYSQL_ENV_MYSQL_USER\") ?: \"root\"/" \
-e "s/\['name'\] = 'phpipam'/\['name'\] = getenv(\"MYSQL_ENV_MYSQL_DB\") ?: \"phpipam\"/" \
-e "s/\['pass'\] = 'phpipamadmin'/\['pass'\] = getenv(\"MYSQL_ENV_MYSQL_ROOT_PASSWORD\")/" \
Expand Down

0 comments on commit a50dfe8

Please sign in to comment.