Add mongoinit to fix initial docker-compose file

This commit is contained in:
Damian Fajfer 2024-04-30 22:09:14 +02:00
parent 70c05dd5f7
commit 73a42b5fd1
No known key found for this signature in database
GPG key ID: 08682A5B9E8CE447

View file

@ -1,4 +1,3 @@
version: '2.2'
services:
sharelatex:
restart: always
@ -108,6 +107,7 @@ services:
restart: always
image: mongo:5.0
container_name: mongo
command: "--replSet overleaf"
expose:
- 27017
volumes:
@ -118,6 +118,20 @@ services:
timeout: 10s
retries: 5
mongoinit:
image: mongo:5.0
# this container will exit after executing the command
restart: no
depends_on:
mongo:
condition: service_healthy
command:
- mongo
- --host
- mongo:27017
- --eval
- 'rs.initiate({ _id: "overleaf", members: [ { _id: 0, host: "mongo:27017" } ] })'
redis:
restart: always
image: redis:6.2