- Select the version of the docker image
- Set container name
- Pull the docker image
- Configure the mongo-express instance
- Set the MongoDB container name
- Set the network parameters
- Run mongo-express
- Use mongo-express
- See the container logs
- Kill the container
- References
IMAGE=mongo-express
TAG=0.54.0NAME=mongo-expressdocker pull $IMAGE:$TAGContents of the .env file.
ME_CONFIG_BASICAUTH_USERNAME=user
ME_CONFIG_BASICAUTH_PASSWORD=webpassword
ME_CONFIG_MONGODB_ADMINUSERNAME=user
ME_CONFIG_MONGODB_ADMINPASSWORD=topsecret
ME_CONFIG_MONGODB_SERVER=mongodb
ME_CONFIG_MONGODB_PORT=27017MONGODB_CONTAINER=mongodbINTERFACE=0.0.0.0
PORT=8081docker run -it --rm -d \
--name $NAME \
-p $INTERFACE:$PORT:8081 \
--env-file .env \
--link $MONGODB_CONTAINER \
mongo-expressOpen the URL in a browser: http://$INTERFACE:8081/.
docker logs $NAMEdocker kill $NAME