I am able to run Mongodb atlas local image using the following command directly in Docker: docker run -p 27017:27017 --name mongo-atlas-play mongodb/mongodb-atlas-local
But, I am not able to run the same image using Docker Compose.
Docker compose file looks like this:
mongo:
image: mongodb/mongodb-atlas-local
ports:
- “27017:27017”
volumes:
- mongo-data:/data/db
- mongo-config:/data/configdb
volumes:
mongo-data:
mongo-config:
These are the error logs I am getting inside that container:
2025-04-29 00:06:50 {“t”:{“$date”:“2025-04-28T18:36:50.580+00:00”},“s”:“I”, “c”:“ACCESS”, “id”:20254, “ctx”:“main”,“msg”:“Read security file failed”,“attr”:{“error”:{“code”:30,“codeName”:“InvalidPath”,“errmsg”:“Error reading file /data/configdb/keyfile: No such file or directory”}}}