I have a docker-compose.yml configured to create and add data to a database. My compose file then loads in a bash script which will run a few short tests on the data and exit 1 upon a test failing. This is working as intended, however when I want my container to exit upon all tests passing but the docker-entrypoint.sh script seems to ignore my exit 0 command. I've attempted to write a different entrypoint script which will call on the docker-entrypoint.sh in hopes that I can then exit the container, but I'm not having any luck. Is there any easy way to implement this?
Output example:
postgres_1 | PostgreSQL init process complete; ready for start up.
postgres_1 |
postgres_1 | 2020-04-06 19:29:58.511 UTC [1] LOG: starting PostgreSQL 12.2 (Debian 12.2-2.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
postgres_1 | 2020-04-06 19:29:58.511 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres_1 | 2020-04-06 19:29:58.511 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres_1 | 2020-04-06 19:29:58.517 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1 | 2020-04-06 19:29:58.534 UTC [102] LOG: database system was shut down at 2020-04-06 19:29:58 UTC
postgres_1 | 2020-04-06 19:29:58.540 UTC [1] LOG: database system is ready to accept connections