mirror of
https://github.com/d0zingcat/ghost-docker.git
synced 2026-05-13 23:16:44 +00:00
Redo MySQL healthcheck to be more generic
no ref - This follows a more Docker standard approach by using MySQL admin's `ping` tool - `start_interval` and `start_period` are required just to give MySQL a bit of time to start up and create the initial DBs on first boot - We need to use `$$` to escape the variable in the compose file so it goes through to the healthcheck as a variable to expanded there
This commit is contained in:
@@ -74,8 +74,10 @@ services:
|
||||
- ${MYSQL_DATA_LOCATION:-./data/mysql}:/var/lib/mysql
|
||||
- ./mysql-init:/docker-entrypoint-initdb.d
|
||||
healthcheck:
|
||||
test: mysql -u${DATABASE_USER:-ghost} -p${DATABASE_PASSWORD:?DATABASE_PASSWORD environment variable is required} ghost -e 'select 1'
|
||||
test: mysqladmin ping -p$$MYSQL_ROOT_PASSWORD -h 127.0.0.1
|
||||
interval: 1s
|
||||
start_period: 30s
|
||||
start_interval: 10s
|
||||
retries: 120
|
||||
networks:
|
||||
- ghost_network
|
||||
|
||||
Reference in New Issue
Block a user