Closed oalders closed 1 year ago
$ docker-compose up pgdb
Attaching to metacpan_pgdb_1
pgdb_1 | Error: Database is uninitialized and superuser password is not specified.
pgdb_1 | You must specify POSTGRES_PASSWORD to a non-empty value for the
pgdb_1 | superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
pgdb_1 |
pgdb_1 | You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
pgdb_1 | connections without a password. This is *not* recommended.
pgdb_1 |
pgdb_1 | See PostgreSQL documentation about "trust":
pgdb_1 | https://www.postgresql.org/docs/current/auth-trust.html
It seems you need to supply a username/password to the env of the postgres container. The following patch already resolves the issue of exit 1 and configures the container.
$ git d
diff --git i/docker-compose.yml w/docker-compose.yml
index 8dac455..dd05bf4 100644
--- i/docker-compose.yml
+++ w/docker-compose.yml
@@ -244,6 +244,10 @@ services:
context: "./pg"
args:
PG_TAG: "${PG_VERSION_TAG:-9.6-alpine}"
+ environment:
+ POSTGRES_PASSWORD: metacpan
+ POSTGRES_USERNAME: metacpan123
+ POSTGRES_DB: metacpan
networks:
- database
healthcheck:
Which leads to another issue:
api_1 | wait-for-it.sh: timeout occurred after waiting 15 seconds for db:5432
api_1 | Server available at http://127.0.0.1:5000
api_1 | Can't load application from file "/metacpan-api/bin/api.pl": DBI connect('dbname=minion_queue;host=pgdb','metacpan',...) failed: fe_sendauth: no password supplied at /usr/local/lib/perl5/site_perl/5.30.1/Mojo/Pg.pm line 91.
api_1 | Compilation failed in require at (eval 91) line 1.
I noticed the suggested changes were implemented.
And also the Automated Operativity Test is successful
Automated Operativity Test for the Component pgdb
Component 'pgdb' finished with:
pgdb_1 | PostgreSQL init process complete; ready for start up.
pgdb_1 |
pgdb_1 | LOG: database system was shut down at 2022-12-29 13:19:11 UTC
pgdb_1 | LOG: MultiXact member wraparound protections are now enabled
pgdb_1 | LOG: database system is ready to accept connections
pgdb_1 | LOG: autovacuum launcher started
pgdb_1 | LOG: incomplete startup packet
So, it seems as if this issue is solved now.
Thanks so much @bodo-hugo-barwich!
It's not clear why the Pg container exits early.