diff --git a/docker-compose.yml b/docker-compose.yml index cf5a697..cc74bb1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,16 +38,13 @@ services: - internal env_file: - stack.env - environment: - - MONGO_INITDB_ROOT_USERNAME=${MONGO_USER} - - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD} - - MONGO_INITDB_DATABASE=mcdi command: ["--auth", "--bind_ip_all"] healthcheck: - test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017 --quiet - interval: 30s - timeout: 10s - retries: 5 + test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping')"] + interval: 10s + timeout: 5s + retries: 10 + start_period: 30s networks: caddy_network: diff --git a/stack.env b/stack.env index cb96ee2..6348a27 100644 --- a/stack.env +++ b/stack.env @@ -1,8 +1,9 @@ CACHEBUST=1736003093 # MongoDB -MONGO_USER=mcdi -MONGO_PASSWORD=changeme-set-a-strong-password +MONGO_INITDB_ROOT_USERNAME=mcdi +MONGO_INITDB_ROOT_PASSWORD=changeme-set-a-strong-password +MONGO_INITDB_DATABASE=mcdi MONGODB_URI=mongodb://mcdi:changeme-set-a-strong-password@mongodb:27017/mcdi?authSource=admin # JWT