diff --git a/app/Actions/Server/StartSentinel.php b/app/Actions/Server/StartSentinel.php index cec90288e..3a37a7328 100644 --- a/app/Actions/Server/StartSentinel.php +++ b/app/Actions/Server/StartSentinel.php @@ -48,7 +48,7 @@ public function handle(Server $server, bool $restart = false, ?string $latestVer } $dockerEnvironments = implode(' ', array_map(fn ($key, $value) => '-e '.escapeshellarg("$key=$value"), array_keys($environments), $environments)); $dockerLabels = implode(' ', array_map(fn ($key, $value) => "$key=$value", array_keys($labels), $labels)); - $dockerCommand = "docker run -d $dockerEnvironments --name coolify-sentinel -v /var/run/docker.sock:/var/run/docker.sock -v $mountDir:/app/db --pid host --health-cmd \"curl --fail http://127.0.0.1:8888/api/health || exit 1\" --health-interval 10s --health-retries 3 --add-host=host.docker.internal:host-gateway --label $dockerLabels $image"; + $dockerCommand = "docker run -d $dockerEnvironments --name coolify-sentinel -v /var/run/docker.sock:/var/run/docker.sock -v $mountDir:/app/db --pid host --health-cmd \"curl --fail http://127.0.0.1:8888/api/health || exit 1\" --health-start-period 120s --health-interval 10s --health-retries 3 --add-host=host.docker.internal:host-gateway --label $dockerLabels $image"; instant_remote_process([ 'docker rm -f coolify-sentinel || true', diff --git a/tests/Unit/StartSentinelEndpointFallbackTest.php b/tests/Unit/StartSentinelEndpointFallbackTest.php index 8da3459b8..20422b2ab 100644 --- a/tests/Unit/StartSentinelEndpointFallbackTest.php +++ b/tests/Unit/StartSentinelEndpointFallbackTest.php @@ -15,3 +15,9 @@ ->and($component) ->toContain('$this->sentinelCustomUrl = $this->server->settings->sentinel_custom_url;'); }); + +test('sentinel startup allows legacy metrics migrations to finish before health checks fail', function () { + $action = file_get_contents(dirname(__DIR__, 2).'/app/Actions/Server/StartSentinel.php'); + + expect($action)->toContain('--health-start-period 120s'); +});