- Add database healthcheck & webapp service depencies.

This commit is contained in:
Arnaud G. GIBERT 2024-10-29 08:51:33 +01:00
parent 04262b54e9
commit 50691ad48b
2 changed files with 16 additions and 1 deletions

View File

@ -3,7 +3,8 @@ Rx3/Ampache-Mga9 V 1.2.3 - A. GIBERT - 2024/10/xx
------------------------------------------------------------------------------------------------------------------------------------
- Fix crontab: user ampache user instead of root and add it to git,
- Fix database restart in compose file.
- Fix database restart in compose file,
- Add database healthcheck & webapp service depencies.

View File

@ -20,6 +20,12 @@ services:
MARIADB_USER: ${MARIADB_USER}
MARIADB_PASSWORD: ${MARIADB_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRESQL_USER} -d ${POSTGRESQL_DATABASE}'"]
interval: 10s
timeout: 3s
retries: 3
volumes:
- ./var/lib/mysql:/var/lib/mysql
@ -46,6 +52,10 @@ services:
restart: unless-stopped
depends_on:
database:
condition: service_healthy
environment:
APACHE_UID: ${APACHE_UID}
APACHE_GID: ${APACHE_GID}
@ -75,6 +85,10 @@ services:
restart: unless-stopped
depends_on:
database:
condition: service_healthy
environment:
APACHE_UID: ${APACHE_UID}
APACHE_GID: ${APACHE_GID}