mirror of
https://github.com/UniversityOfHelsinkiCS/oodikone.git
synced 2026-10-12 19:03:39 +03:00
[DockerCompose] Add host to db healthchecks to wait for initdb scripts to run
This commit is contained in:
committed by
Aaro Koivukangas
parent
25c14aac0f
commit
2eeb9b0bd0
@@ -2,9 +2,11 @@ x-defaults: &defaults
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
x-healthcheck-defaults: &healthcheck-defaults
|
x-healthcheck-defaults: &healthcheck-defaults
|
||||||
interval: 1s
|
interval: 30s # Normal healthcehck interval
|
||||||
timeout: 3s
|
timeout: 5s
|
||||||
retries: 30
|
retries: 10 # Retries until SIGKILl
|
||||||
|
start_interval: 3s # How often healthcheck runs while starting
|
||||||
|
start_period: 15s # How long startup period is
|
||||||
|
|
||||||
services:
|
services:
|
||||||
kone-db:
|
kone-db:
|
||||||
|
|||||||
+11
-9
@@ -4,9 +4,11 @@ x-defaults: &defaults
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
x-healthcheck-defaults: &healthcheck-defaults
|
x-healthcheck-defaults: &healthcheck-defaults
|
||||||
interval: 1s
|
interval: 30s # Normal healthcehck interval
|
||||||
timeout: 3s
|
timeout: 5s
|
||||||
retries: 30
|
retries: 10 # Retries until SIGKILl
|
||||||
|
start_interval: 3s # How often healthcheck runs while starting
|
||||||
|
start_period: 30s # How long startup period is
|
||||||
|
|
||||||
services:
|
services:
|
||||||
backend:
|
backend:
|
||||||
@@ -71,7 +73,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 4321:5432
|
- 4321:5432
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|
||||||
user-db:
|
user-db:
|
||||||
@@ -85,7 +87,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 4320:5432
|
- 4320:5432
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
@@ -112,7 +114,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 12345:5432
|
- 12345:5432
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|
||||||
sis-importer-db:
|
sis-importer-db:
|
||||||
@@ -124,7 +126,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 12346:5432
|
- 12346:5432
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|
||||||
jami:
|
jami:
|
||||||
@@ -145,14 +147,14 @@ services:
|
|||||||
jami-db:
|
jami-db:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
container_name: oodikone-jami-db
|
container_name: oodikone-jami-db
|
||||||
image: postgres:15.10
|
image: registry-toska.ext.ocp-prod-0.k8s.it.helsinki.fi/jami-db
|
||||||
environment:
|
environment:
|
||||||
- PGDATA=/data
|
- PGDATA=/data
|
||||||
- POSTGRES_PASSWORD=postgres
|
- POSTGRES_PASSWORD=postgres
|
||||||
ports:
|
ports:
|
||||||
- 5433:5432
|
- 5433:5432
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|
||||||
# This is still needed to make backend calls correctly route from localhost:5000/api to localhost:8080
|
# This is still needed to make backend calls correctly route from localhost:5000/api to localhost:8080
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ x-defaults: &defaults
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
x-healthcheck-defaults: &healthcheck-defaults
|
x-healthcheck-defaults: &healthcheck-defaults
|
||||||
interval: 1s
|
interval: 30s # Normal healthcehck interval
|
||||||
timeout: 3s
|
timeout: 5s
|
||||||
retries: 30
|
retries: 10 # Retries until SIGKILl
|
||||||
|
start_interval: 3s # How often healthcheck runs while starting
|
||||||
|
start_period: 30s # How long startup period is
|
||||||
|
|
||||||
services:
|
services:
|
||||||
sis-db:
|
sis-db:
|
||||||
@@ -23,5 +25,5 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 12345:5432
|
- 12345:5432
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|||||||
+11
-9
@@ -7,9 +7,11 @@ x-build_defaults: &build_defaults
|
|||||||
dockerfile: dev.Dockerfile
|
dockerfile: dev.Dockerfile
|
||||||
|
|
||||||
x-healthcheck-defaults: &healthcheck-defaults
|
x-healthcheck-defaults: &healthcheck-defaults
|
||||||
interval: 1s
|
interval: 30s # Normal healthcehck interval
|
||||||
timeout: 3s
|
timeout: 5s
|
||||||
retries: 30
|
retries: 10 # Retries until SIGKILl
|
||||||
|
start_interval: 3s # How often healthcheck runs while starting
|
||||||
|
start_period: 30s # How long startup period is
|
||||||
|
|
||||||
services:
|
services:
|
||||||
adminer:
|
adminer:
|
||||||
@@ -94,7 +96,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- kone-db-data:/data
|
- kone-db-data:/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|
||||||
user-db:
|
user-db:
|
||||||
@@ -108,7 +110,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- user-db-data:/data
|
- user-db-data:/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
@@ -134,7 +136,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 12345:5432
|
- 12345:5432
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|
||||||
sis-importer-db:
|
sis-importer-db:
|
||||||
@@ -148,7 +150,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 12346:5432
|
- 12346:5432
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|
||||||
jami:
|
jami:
|
||||||
@@ -171,7 +173,7 @@ services:
|
|||||||
jami-db:
|
jami-db:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
container_name: oodikone-jami-db
|
container_name: oodikone-jami-db
|
||||||
image: postgres:15.10
|
image: registry-toska.ext.ocp-prod-0.k8s.it.helsinki.fi/jami-db
|
||||||
environment:
|
environment:
|
||||||
- PGDATA=/data
|
- PGDATA=/data
|
||||||
- POSTGRES_PASSWORD=postgres
|
- POSTGRES_PASSWORD=postgres
|
||||||
@@ -180,7 +182,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- jami-data:/data
|
- jami-data:/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-h', '127.0.0.1']
|
||||||
<<: *healthcheck-defaults
|
<<: *healthcheck-defaults
|
||||||
|
|
||||||
sis-updater-worker:
|
sis-updater-worker:
|
||||||
|
|||||||
Reference in New Issue
Block a user