benhutchins / docker-taiga

Docker container for Taiga https://taiga.io
https://hub.docker.com/r/benhutchins/taiga/
GNU General Public License v3.0
288 stars 154 forks source link

Allow time for postgres to spin up #74

Closed proofoftom closed 5 years ago

proofoftom commented 5 years ago

Otherwise the web container may start too quickly, fail and exit

docker-compose up
Starting mytaiga_postgres_1 ... done
Starting mytaiga_taiga_1    ... done
Attaching to mytaiga_postgres_1, mytaiga_taiga_1
taiga_1     | Running database check
taiga_1     | Connecting to database:
taiga_1     | dbname='taigadb' user='taiga' host='postgres' password='password'
taiga_1     | Traceback (most recent call last):
taiga_1     |   File "/checkdb.py", line 14, in <module>
taiga_1     |     conn = psycopg2.connect(conn_string)
taiga_1     |   File "/usr/local/lib/python3.5/site-packages/psycopg2/__init__.py", line 130, in connect
taiga_1     |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
taiga_1     | psycopg2.OperationalError: could not connect to server: Connection refused
taiga_1     |   Is the server running on host "postgres" (172.23.0.2) and accepting
taiga_1     |   TCP/IP connections on port 5432?
taiga_1     |
taiga_1     | Failed to connect to database server or database does not exist.
mytaiga_taiga_1 exited with code 1
postgres_1  | 2019-03-12 06:43:02.057 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres_1  | 2019-03-12 06:43:02.057 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres_1  | 2019-03-12 06:43:02.061 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1  | 2019-03-12 06:43:02.135 UTC [23] LOG:  database system was interrupted; last known up at 2019-03-12 06:28:04 UTC
postgres_1  | 2019-03-12 06:43:05.081 UTC [23] LOG:  database system was not properly shut down; automatic recovery in progress
postgres_1  | 2019-03-12 06:43:05.137 UTC [23] LOG:  redo starts at 0/1650A90
postgres_1  | 2019-03-12 06:43:05.138 UTC [23] LOG:  invalid record length at 0/1650B70: wanted 24, got 0
postgres_1  | 2019-03-12 06:43:05.138 UTC [23] LOG:  redo done at 0/1650B38
postgres_1  | 2019-03-12 06:43:05.282 UTC [1] LOG:  database system is ready to accept connections