everate/docker-compose.yml

36 lines
1,014 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

services:
mongo:
image: mongo
container_name: mongo
restart: unless-stopped
# ---------- credentials ----------
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
# ---------- persistence ----------
volumes:
# primary data store
- mongo_data:/data/db
# (optional) replicaset metadata; small but useful to persist
- mongo_cfg:/data/configdb
# seed scripts for firstrun init (create users, seed collections, etc.)
- ./mongo/init:/docker-entrypoint-initdb.d:ro
# ---------- networking ----------
# Only published when the 'dev' profile is active
ports:
- "${MONGO_PORT}:27017"
# ---------- basic health check ----------
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping')"]
interval: 30s
timeout: 10s
retries: 5
# ---------- named volumes ----------
volumes:
mongo_data:
mongo_cfg: