diff options
author | 2021-09-09 15:54:17 +0100 | |
---|---|---|
committer | 2021-09-17 13:39:30 +0100 | |
commit | c9aed176706852196fec0fc65ee7552d511316f2 (patch) | |
tree | 3139a22711e0f0f67582b215b85ed147292a3edb /docker-compose.yml | |
parent | Init metricity using docker-compose init volume (diff) |
Move psql health check to docker compose file
Diffstat (limited to 'docker-compose.yml')
-rw-r--r-- | docker-compose.yml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/docker-compose.yml b/docker-compose.yml index 05867a46..eb987624 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,11 @@ services: POSTGRES_DB: pysite POSTGRES_PASSWORD: pysite POSTGRES_USER: pysite + healthcheck: + test: ["CMD-SHELL", "pg_isready -U pysite"] + interval: 2s + timeout: 1s + retries: 5 volumes: - ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql @@ -35,7 +40,8 @@ services: ports: - "127.0.0.1:8000:8000" depends_on: - - postgres + postgres: + condition: service_healthy tty: true volumes: - .:/app:ro |