Docker Community Forums

Share and learn in the Docker community.

Need assistance to find correct path of resolution

I’m new to docker and really need someone with experience to guide me onto the right path, or even better a solid solution to this problem I am facing.

I am on a macbook running Catalina.

I have limited storage space on my system drive and purchased a large external solid state drive.

I need to run MongoDB 3.6 and restore a massive database onto the external drive

I have MongoDB 4 installed on my macbook and other apps are using it so I cannot uninstall and install 3.6.

I have multiple web apps that need to connect to the MongoDB 3.6 db

My thought was to run MongoDB 3.6 inside of a docker container and bind the /data/db directory that MongoDB is looking for to the host’s external ssd /Volumes/X2T/data
And then run each web app inside it’s own docker container and have them work with the Mongo container

After spending 16 hours on this so far, I have learned that (and correct me if I am wrong) Docker on Mac uses a VM for the daemon, is not an fsync compatible filesystem, is not compatible with MongoDB.

Thus I decided to build a linux laptop to host the MongoDB docker container and that should be compatible in theory.

Finally, my questions are as follows:

Can I expose the MongoDB container’s host port to my LAN and connect to it from within the docker containers on my macbook (also on my LAN)? And if so, what would the process be?

I am wanting to write a docker-compose.yml file that will handle spinning up the web apps and the database containers. I assume since I will have two hosts, that I will require two compose files, one for the database and one for the web apps.
How can I make sure that the database container is up and running and accessible before the web apps are started?

This is not for production, just for local development purposes.

I would like to know what is the suggested/recommended path of least resistance to achieve the end result that I need? develop multiple web apps on the macbook, storing Mongo 3.6 database on external SSD, keeping Mongo 4 database running on the macbook as it powers other software I use on the macbook.

Thank you for your time. If this isn’t the right category to post this, I apologize.