app: Use hostname instead of ip for database

This commit is contained in:
Yi EungJun committed 2016-01-25 15:46:08 +09:00
1 parent ac9ce4a2a9
commit 75bb4944ac
4 files changed
+4 -7

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@
},
"SqlSettings": {
"DriverName": "postgres",
"DataSource": "postgres://mmuser:mmuser_password@PG_ADDR:PG_PORT/mattermost?sslmode=disable&connect_timeout=10",
"DataSource": "postgres://mmuser:mmuser_password@db:DB_PORT/mattermost?sslmode=disable&connect_timeout=10",
"DataSourceReplicas": [],
"MaxIdleConns": 10,
"MaxOpenConns": 10,
+2 -3
View File
@@ -4,8 +4,7 @@ echo -ne "Configure database connection..."
if [ ! -f $config ]
then
cp /config.template.json $config
sed -Ei "s/PG_ADDR/$PG_PORT_5432_TCP_ADDR/" $config
sed -Ei "s/PG_PORT/$PG_PORT_5432_TCP_PORT/" $config
sed -Ei "s/DB_PORT/$DB_PORT_5432_TCP_PORT/" $config
echo OK
else
echo SKIP
@@ -13,7 +12,7 @@ fi
# Wait to avoid "panic: Failed to open sql connection pq: the database system is starting up"
echo "Wait until database is ready..."
until nc -z $PG_PORT_5432_TCP_ADDR $PG_PORT_5432_TCP_PORT
until nc -z db $DB_PORT_5432_TCP_PORT
do
sleep 1
done