Skip to content

Commit e77bfae

Browse files
committed
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.
1 parent 8fcba8b commit e77bfae

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,7 @@ services:
12881288
image: mongo:8.2.5
12891289
container_name: appwrite-mongodb
12901290
<<: *x-logging
1291+
restart: on-failure:3
12911292
networks:
12921293
- appwrite
12931294
volumes:

0 commit comments

Comments
 (0)