1
0
mirror of https://github.com/x86dev/docker-ttrss synced 2025-12-13 01:46:00 +00:00

Moved waitforit into Dockerfile, added to cont-init.d

This commit is contained in:
David Young
2017-07-21 22:22:01 +12:00
parent 34fb586912
commit 79c5cd91f3
3 changed files with 25 additions and 177 deletions

View File

@@ -0,0 +1,22 @@
#!/usr/bin/with-contenv sh
# Wait for the DB to be reachable before proceeding. This avoids race condition
# whereby database is not ready (yet), and so TTRSS config isn't correctly created
#############
# This simply duplicates the logic from ttrss-configure-db.php
ename = 'DB';
eport = 5432;
if [ $DB_TYPE = 'pgsql ];
then
eport = 5432;
dbhost = DB_PORT_5432_TCP_ADDR
else
eport = 3306;
dbhost = DB_PORT_3306_TCP_ADDR
fi
#############
# Run wait-for-it.sh to confirm DB comes up before we proceed
/srv/wait-for-it.sh $dbhost:$eport