This repository has been archived on 2021-08-31. You can view files and clone it, but cannot push or open issues or pull requests.
mattermost/app/docker-entry.sh

29 lines
607 B
Bash
Raw Normal View History

#!/bin/bash
config=/mattermost/config/config.json
2015-12-09 09:17:25 +01:00
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
2015-12-09 09:17:25 +01:00
echo OK
else
echo SKIP
fi
2015-12-09 09:17:25 +01:00
echo -n "Wait until database is ready..."
until nc -z $PG_PORT_5432_TCP_ADDR $PG_PORT_5432_TCP_PORT
do
echo -n .
sleep 1
done
# Wait to avoid "panic: Failed to open sql connection pq: the database system is starting up"
sleep 1
echo "OK"
echo "Starting platform"
cd /mattermost/bin
./platform