I try to run MongoDB and Mongo-express by Docker-compose. I use following config:
version: \'3\'
services:
mongo:
image: mongo
environment:
Running it like this just worked for me maybe it helps you
mongoex:
image: mongo-express
environment:
- ME_CONFIG_OPTIONS_EDITORTHEME=ambiance
- ME_CONFIG_MONGODB_SERVER=database
- ME_CONFIG_MONGODB_PORT=27017
- ME_CONFIG_MONGODB_ENABLE_ADMIN=false
- ME_CONFIG_MONGODB_AUTH_DATABASE=admin
ports:
- "8081:8081"
links:
- database
database:
image: mongo:latest
command: --smallfiles
ports:
- "27017:27017"
good luck and regards!