Last active
September 5, 2019 14:42
-
-
Save NyaGarcia/0606d59c3dcbf4489cfea1cce8f4f1ca to your computer and use it in GitHub Desktop.
MongoDB Compose file using string interpolation to assign values to the environment variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
services: | |
db: | |
container_name: Mongo-db | |
image: mongo:latest | |
restart: always | |
volumes: | |
- ./myData:/data/db | |
environment: | |
- MONGO_INITDB_DATABASE=${DATABASE} | |
- MONGODB_USER=${USERNAME} | |
- MONGODB_PASS=${PASS} | |
ports: | |
- 27020:27017 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment