summaryrefslogtreecommitdiffstats
path: root/docker-compose.yml
diff options
context:
space:
mode:
authorDessalines <happydooby@gmail.com>2019-04-06 11:08:05 -0700
committerDessalines <happydooby@gmail.com>2019-04-06 11:08:05 -0700
commitbe5bd77eec663c0e7b4f0bbf4292936e4e55c95e (patch)
treefdcb370c5ead66478c9fe00d6f6b435dc134f6d9 /docker-compose.yml
parent011e34c3eb4fc398ca691aab17ce1d56406748e7 (diff)
Adding health check to docker-compose.
Diffstat (limited to 'docker-compose.yml')
-rw-r--r--docker-compose.yml13
1 files changed, 9 insertions, 4 deletions
diff --git a/docker-compose.yml b/docker-compose.yml
index c2b2bfec..c11c9176 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,4 +1,4 @@
-version: '3'
+version: '2.4'
services:
db:
@@ -8,6 +8,11 @@ services:
POSTGRES_USER: rrr
POSTGRES_PASSWORD: rrr
POSTGRES_DB: rrr
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U rrr"]
+ interval: 30s
+ timeout: 30s
+ retries: 3
lemmy:
build:
context: .
@@ -17,6 +22,6 @@ services:
environment:
LEMMY_FRONT_END_DIR: /app/dist
DATABASE_URL: postgres://rrr:rrr@db:5432/rrr
-
- links:
- - db
+ depends_on:
+ db:
+ condition: service_healthy