Skip to content

Commit

Permalink
Use Environment variables for mongdb
Browse files Browse the repository at this point in the history
  • Loading branch information
koechkevin committed Jan 23, 2024
1 parent facb1e8 commit ba52dbf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
context: .
dockerfile: Dockerfile.charterafrica
args:
MONGO_URL: mongodb://root:rootpassword@host.docker.internal:27017/charterafrica?authSource=admin&directConnection=true
MONGO_URL: mongodb://${MONGO_INITDB_ROOT_USERNAME:-root}:${MONGO_INITDB_ROOT_PASSWORD:-rootpassword}@host.docker.internal:${MONGODB_PORT:-27017}/charterafrica?authSource=admin&directConnection=true
PAYLOAD_SECRET_KEY: ${PAYLOAD_SECRET_KEY}
SENTRY_AUTH_TOKEN: ${SENTRY_AUTH_TOKEN}
SENTRY_ORG: ${SENTRY_ORG}
Expand All @@ -28,10 +28,12 @@ services:
container_name: mongodb
image: mongo:6.0.13
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: rootpassword
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME:-root}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD:-rootpassword}
ports:
- 27017:27017
- ${MONGODB_PORT:-27017}:27017
env_file:
- apps/charterafrica/.env.local
volumes:
- ./contrib/docker/db:/data/db
- ./mongo-keyfile:/etc/mongo-keyfile
Expand Down

0 comments on commit ba52dbf

Please sign in to comment.