How to change default port of mongodb-atlas-local

Adding hostname to the config fixed it. Thanks for your help @Jonny_Roberts

Here’s my working configuration
docker-compose-yml

services:
  dba:
    image: mongodb/mongodb-atlas-local:8.0.4
    hostname: mongodb
    env_file:
      - .env.docker.local # passwords and stuff
    container_name: dba
    volumes:
      - dba-data:/data/db
      - dba-config:/data/configdb
    ports:
      - 27018:27017

volumes:
  dba-data:
  dba-config:

Connection string ``mongodb://localhost:27018/?directConnection=true`

1 Like