Problem Running Mongodb Atlas Local image using Docker Compose

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”}}}

Hi @Yaswanth_Karre1 I’ve not been able to reproduce this error. Here’s a plain Docker Compose file that does run:

  mongodb:
    hostname: mongodb
    image: mongodb/mongodb-atlas-local
    volumes:
      - mongo-data:/data/db
      - mongo-config:/data/configdb
    ports:
      - 27018:27017
volumes:
  mongo-data:
  mongo-config: 

Note the 27018:27018, this is just to avoid any clash if you’ve also got a container running via docker run at 27018:27018. You can read more about using Docker Compose in the documentation here.

Let me know how you get on, if you hit any more issues perhaps you could send over some repro steps?