Closed sanak closed 2 years ago
Using external IP (address) in docker-compose.yml
healthcheck (from https://github.com/postgis/docker-postgis/pull/297#issuecomment-1147603192) is enough handy, so I close this issue.
--- a/docker-compose.yml
+++ b/docker-compose.yml
volumes:
- postgis:/var/lib/postgresql/data
+ healthcheck:
+ test: "pg_isready -h postgis -U ${DB_USER} -d ${DB_NAME}"
+ interval: 10s
+ timeout: 2s
+ retries: 5
+ start_period: 10s
redmine:
:
depends_on:
- - postgis
+ postgis:
+ condition: service_healthy
From #290 and #292, reconnecting database during init process was introduced, but this makes a dependency service management harder in
docker-compose.yml
like the following redmine usecase, because redmine database migration process starts before reconnecting database and failed. https://github.com/gtt-project/docker-gtt/blob/feature/simplify-docker-settings/docker-compose.ymldocker-compose.yml
side workaround is possible by waiting for lastpostgis_tiger_geocoder
extension like as follows, but this is not handy.So, if possible, without reconnecting database during init process is preferable.
The following diff is my suggestion, but I am not sure whether the sessions are separated and original #290 issue will be solved by this.