Hi, I’m trying to setup local atlas deployment using the mongodb/mongodb-atlas-local docker image as described here: https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-docker/
But I can’t find any solution to change the port of database. I can using mapping of course such as:
Running the atlas local image from the command line successfully starts mongo atlas local and allows connections. What’s missing from the docker compose configuration to allow this container to start successfully?
My development environment is MacOs 15.2, Docker Desktop 4.37.1.
Hi @Jonny_Roberts No, I’m not connection with directConnection=true because I don’t want to. I want it to behave exactly the same in dev mode like in atlas production.
So I need to change the port of mongo and host of replica set to localhost, but it looks it’s not possible?
EDIT: @Chris_Norris after a bit more investigation I think you may have bumped into an issue with changing the hostname. When the hostname changes (in this case to dba) , and you stop the container you also need to remove the volume; if you compose up with the old volume and new hostname, this’ll cause the error you’re seeing.
So, can you try docker compose down -v to stop the container and remove the volume, then docker compose up and it should work again (with 7.0.16, which is fine - I’ve updated the example compose file and added the compose up and down commands)
@Jonny_Roberts it’s possible to pass mongod.conf file somehow to mongo? I tried to replace it inside container (`/etc/mongod.conf) but the configuration is not used
This is really bad that configuration of mongo in this atlas version is so restricted…
Hi @Martin_Forejt ok, thanks for the clarification. Currently the requirement of directConnection is as designed, but I will reach out to you directly as I would like to learn more about your use case here. Thanks.
I have a similar use case where I need to call ttlMonitorEnabled=false with setParameter for our CI. The easiest way would be to pass the parameter at mongod startup. Unfortunately this option is unavailable from commandline, nor /etc/mongod.conf.
We resorted to spinning up an extra thread to call mongosh --eval 'db.adminCommand({ setParameter:1, ttlMonitorEnabled: false })' some time after the service is healthy, but this is hardly optimal.
Please consider allowing a hook to set startup parameters!