18c82ea9c6
The app should wait for a moment even after TCP connection to the
database is available.
Rollback a part of ac0b706
.
25 lines
503 B
Bash
25 lines
503 B
Bash
#!/bin/bash
|
|
config=/mattermost/config/config.json
|
|
echo -ne "Configure database connection..."
|
|
if [ ! -f $config ]
|
|
then
|
|
cp /config.template.json $config
|
|
sed -Ei "s/DB_PORT/$DB_PORT_5432_TCP_PORT/" $config
|
|
echo OK
|
|
else
|
|
echo SKIP
|
|
fi
|
|
|
|
echo "Wait until database is ready..."
|
|
until nc -z db $DB_PORT_5432_TCP_PORT
|
|
do
|
|
sleep 1
|
|
done
|
|
|
|
# Wait to avoid "panic: Failed to open sql connection pq: the database system is starting up"
|
|
sleep 1
|
|
|
|
echo "Starting platform"
|
|
cd /mattermost/bin
|
|
./platform
|