fix: docker compose mariadb/postgres healtcheck, fix #397

This commit is contained in:
lesion 2024-08-21 15:54:32 +02:00
parent e4a648be1d
commit 30c932a7f2
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 18 additions and 3 deletions

View file

@ -2,7 +2,7 @@ version: '3'
services: services:
db: db:
image: mariadb image: mariadb:11
container_name: mariadb container_name: mariadb
volumes: volumes:
- ./db:/var/lib/mysql - ./db:/var/lib/mysql
@ -14,6 +14,12 @@ services:
- MARIADB_PASSWORD=gancio - MARIADB_PASSWORD=gancio
- MARIADB_RANDOM_ROOT_PASSWORD=yes - MARIADB_RANDOM_ROOT_PASSWORD=yes
restart: always restart: always
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--mariadbupgrade"]
interval: 2s
timeout: 5s
retries: 10
gancio: gancio:
restart: always restart: always
image: cisti/gancio image: cisti/gancio
@ -33,4 +39,6 @@ services:
ports: ports:
- "127.0.0.1:13120:13120" - "127.0.0.1:13120:13120"
depends_on: depends_on:
- db db:
condition: service_healthy

View file

@ -12,6 +12,11 @@ services:
- POSTGRES_DB=gancio - POSTGRES_DB=gancio
- POSTGRES_PASSWORD=gancio - POSTGRES_PASSWORD=gancio
- PGDATA=/var/lib/postgresql/data - PGDATA=/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 2s
timeout: 5s
retries: 10
restart: always restart: always
ports: ports:
- 5432:5432 - 5432:5432
@ -34,4 +39,6 @@ services:
ports: ports:
- "127.0.0.1:13120:13120" - "127.0.0.1:13120:13120"
depends_on: depends_on:
- db db:
condition: service_healthy