mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-08-14 16:00:25 +02:00
feat: add optional MongoDB replica deployment (#765)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
name: anonymous-github-mongo-secondary
|
||||
|
||||
services:
|
||||
mongodb-secondary:
|
||||
image: ${MONGO_IMAGE:-mongo:latest}
|
||||
restart: unless-stopped
|
||||
entrypoint:
|
||||
- /bin/bash
|
||||
- /opt/anonymous-github/mongodb-replica-entrypoint.sh
|
||||
command:
|
||||
- --quiet
|
||||
- --replSet
|
||||
- rs0
|
||||
- --keyFile
|
||||
- /tmp/mongo-replica-keyfile
|
||||
- --bind_ip_all
|
||||
environment:
|
||||
MONGO_REPLICA_KEYFILE_PATH: /run/secrets/mongo-replica-keyfile
|
||||
volumes:
|
||||
- mongodb_secondary_data:/data/db
|
||||
- ${MONGO_REPLICA_KEYFILE:-./secrets/mongo-replica-keyfile}:/run/secrets/mongo-replica-keyfile:ro
|
||||
- ./scripts/mongodb-replica-entrypoint.sh:/opt/anonymous-github/mongodb-replica-entrypoint.sh:ro
|
||||
ports:
|
||||
- ${MONGO_BIND_ADDRESS:-127.0.0.1}:27017:27017
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- mongosh
|
||||
- --quiet
|
||||
- --eval
|
||||
- "db.adminCommand('ping')"
|
||||
interval: 10s
|
||||
timeout: 10s
|
||||
retries: 12
|
||||
start_period: 10s
|
||||
|
||||
volumes:
|
||||
mongodb_secondary_data:
|
||||
Reference in New Issue
Block a user