Files
overleaf-cep/tools/reference_stack_compose/mongo-probe/compose.yaml
T

27 lines
870 B
YAML

# mongo-probe — protocol-level liveness check of the stack Mongo.
# Reuses the stack's own mongo image: its mongosh is the canonical client.
# healthy == the db answers a real ping (same pattern as the OlliTeX
# toolkit mongo-probe).
services:
mongo-probe:
image: mongo:${MONGO_VERSION:-9.0}
container_name: mongo-probe
hostname: mongo-probe
restart: unless-stopped
command: ["sh", "-c", "sleep infinity"]
environment:
MONGO_HOSTNAME: ${MONGO_HOSTNAME:-mongo}
MONGO_PORT: ${MONGO_PORT:-27017}
healthcheck:
test: ["CMD-SHELL", "mongosh --quiet --host ${MONGO_HOSTNAME} --port ${MONGO_PORT} --eval 'db.adminCommand({ping:1})' >/dev/null 2>&1 || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
networks:
- overleaf-network
networks:
overleaf-network:
external: true