From e77bfae09170868ad4138e557a266b75b7b28557 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 15 Apr 2026 09:19:02 +0530 Subject: [PATCH] fix: add restart policy to MongoDB container for flaky CI starts MongoDB's official Docker entrypoint uses a two-phase startup: a temporary mongod for user/db init, then the real mongod. Under CI resource pressure the port may not be released between the two phases, causing mongod to exit with code 48 (address already in use). Adding restart: on-failure:3 lets Docker handle the transient failure natively. On restart the data directory already exists so the entrypoint skips the two-phase init entirely, avoiding the race. --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index aa2bfdd16a..391d71fb48 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1288,6 +1288,7 @@ services: image: mongo:8.2.5 container_name: appwrite-mongodb <<: *x-logging + restart: on-failure:3 networks: - appwrite volumes: