From 39fe7aa2a51b289ee4474c429445978a1ac04de9 Mon Sep 17 00:00:00 2001 From: Puru <5674762+tuladhar@users.noreply.github.com> Date: Tue, 20 May 2025 03:49:38 +0545 Subject: [PATCH] fix(docker-compose): increase retry for server service (#11883) ## Background I'm trying to self-host twenty using [official 1-Click w/ Docker Compose guide](https://twenty.com/developers/section/self-hosting/docker-compose) on AWS EC2 (using `t3.small` instance type). ## What happened I used the one-line script but it failed with ``` [skipped] server-1 | Successfuly migrated DB! dependency failed to start: container twenty-server-1 is unhealthy ``` Then I tried manual steps, and it failed again with same issue as above. No configuration changed, everything default used. I re-run manual steps multiple times with `docker compose down -v` and `docker compose up`, everything time it failed with `server` unhealthy as it seems server takes longer than configured health check duration (which is 50 seconds) Here's the `time` summary running it: ``` [skipped] server-1 | Successfuly migrated DB! dependency failed to start: container twenty-server-1 is unhealthy ________________________________________________________ Executed in 58.26 secs fish external usr time 661.43 millis 362.00 micros 661.07 millis sys time 646.10 millis 212.00 micros 645.89 millis root@ip-10-0-10-43 ~/twenty [1]# ``` ## Why it happend My hunch (new to twenty, just used it yesterday) is that server service takes much longer to become healthy with DB migration and etc, that configured health check retries is not sufficient. ## What solution worked Increased the retry for server service from 10 to 20, and it worked and service came up healthy (everytime). The increase wasn't needed for db or worker service, just server service. If this all makes sense, please feel free to merge this, so it'll be smoother experience for others new to self-hosting twenty. --- packages/twenty-docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/twenty-docker/docker-compose.yml b/packages/twenty-docker/docker-compose.yml index c883e75c8..929f4e2a1 100644 --- a/packages/twenty-docker/docker-compose.yml +++ b/packages/twenty-docker/docker-compose.yml @@ -65,7 +65,7 @@ services: test: curl --fail http://localhost:3000/healthz interval: 5s timeout: 5s - retries: 10 + retries: 20 restart: always worker: