Created
January 20, 2020 10:32
-
-
Save fenying/c78c14c2a7d472a115e633fcd203c7e9 to your computer and use it in GitHub Desktop.
Deploy MongoDB inside docker.
This file contains 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
#!/bin/bash | |
MONGO_DOCKER_MAX_MEMORY=512M | |
MONGO_DOCKER_PORT=27017 | |
MONGO_DOCKER_DATA_DIR=/data/db | |
MONGO_DOCKER_NAME=Mongo-Server | |
MONGO_LOCAL_PORT=27017 | |
MONGO_LOCAL_DATA_DIR=/docker/mongo/db | |
docker run \ | |
-d \ | |
-m $MONGO_DOCKER_MAX_MEMORY \ | |
-p $MONGO_LOCAL_PORT:$MONGO_DOCKER_PORT \ | |
-v $MONGO_LOCAL_DATA_DIR:$MONGO_DOCKER_DATA_DIR \ | |
--name "$MONGO_DOCKER_NAME" \ | |
mongo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment