fix: pass MongoDB init credentials via env_file, not shell interpolation
This commit is contained in:
parent
a50ce40d83
commit
8c2ddd2b2c
2 changed files with 8 additions and 10 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue