Merge pull request #20685 from overleaf/jpa-fix-local-e2e

[server-ce] use database init script for setting up mongo replica set

GitOrigin-RevId: cf5c820a8c26da43de2f5c66677dba2c40a3667e
This commit is contained in:
Jakob Ackermann
2024-10-14 11:00:03 +00:00
committed by Copybot
parent e4f0ea83e7
commit 2b72d89171
4 changed files with 29 additions and 66 deletions
+8 -3
View File
@@ -8,9 +8,6 @@ services:
condition: service_healthy
redis:
condition: service_started
host-admin:
# The host-admin service initiates the mongo replica set
condition: service_healthy
mailtrap:
condition: service_started
environment:
@@ -40,6 +37,14 @@ services:
mongo:
image: mongo:5.0.17
command: '--replSet overleaf'
volumes:
- ../mongodb-init-replica-set.js:/docker-entrypoint-initdb.d/mongodb-init-replica-set.js
environment:
MONGO_INITDB_DATABASE: sharelatex
extra_hosts:
# Required when using the automatic database setup for initializing the replica set.
# This override is not needed when running the setup after starting up mongo.
- mongo:127.0.0.1
healthcheck:
test: echo 'db.stats().ok' | mongo localhost:27017/test --quiet
interval: 3s