diff --git a/blueprints/erpnext-v16/docker-compose.yml b/blueprints/erpnext-v16/docker-compose.yml index da7ea9f1..3201b4d7 100644 --- a/blueprints/erpnext-v16/docker-compose.yml +++ b/blueprints/erpnext-v16/docker-compose.yml @@ -172,18 +172,12 @@ services: replicas: ${CREATE_SITE:-0} restart_policy: condition: none - depends_on: - db: - condition: service_healthy - redis-cache: - condition: service_healthy - redis-queue: - condition: service_healthy - configurator: - condition: service_completed_successfully entrypoint: ["bash", "-c"] command: - > + wait-for-it -t 300 $${DB_HOST}:$${DB_PORT}; + wait-for-it -t 120 redis-cache:6379; + wait-for-it -t 120 redis-queue:6379; export start=`date +%s`; until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \ [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \ @@ -222,17 +216,10 @@ services: replicas: ${MIGRATE:-0} restart_policy: condition: none - depends_on: - frontend: - condition: service_healthy - configurator: - condition: service_completed_successfully - create-site: - condition: service_completed_successfully entrypoint: ["bash", "-c"] command: - > - curl -f -H "Host: ${SITE_NAME}" http://frontend:8080/api/method/ping || { echo "Site busy"; exit 0; }; + curl -f -H "Host: ${SITE_NAME}" http://frontend:8080/api/method/ping || { echo "Site not reachable yet, skipping migration"; exit 0; }; bench --site all set-config -p maintenance_mode 1; bench --site all set-config -p pause_scheduler 1; bench --site all migrate; @@ -250,10 +237,10 @@ services: condition: always healthcheck: test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] - start_period: 10s - interval: 10s + start_period: 120s + interval: 5s timeout: 5s - retries: 3 + retries: 30 command: - --character-set-server=utf8mb4 - --collation-server=utf8mb4_unicode_ci