diff --git a/compose.yaml b/compose.yaml index 2a5c8ca..2c8baf1 100644 --- a/compose.yaml +++ b/compose.yaml @@ -14,9 +14,9 @@ services: - ./data:/docker-entrypoint-initdb.d:ro networks: - comcms_network - command: --default-authentication-plugin=mysql_native_password + command: --mysql-native-password=ON healthcheck: - test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ] + test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-root}" ] timeout: 20s retries: 10 @@ -29,9 +29,23 @@ services: - redis_data:/data networks: - comcms_network - command: redis-server --requirepass ${REDIS_PASSWORD:-} + command: > + sh -c " + if [ -n \"${REDIS_PASSWORD}\" ]; then + redis-server --requirepass \"${REDIS_PASSWORD}\" + else + redis-server + fi + " healthcheck: - test: [ "CMD", "redis-cli", "ping" ] + test: > + CMD sh -c " + if [ -n \"${REDIS_PASSWORD}\" ]; then + redis-cli -a \"${REDIS_PASSWORD}\" ping + else + redis-cli ping + fi + " interval: 30s timeout: 10s retries: 3