innovationOUtside / tm351vm-binder

See if we can generate a Binder/repo2docker build of the TM351 VM
MIT License
7 stars 4 forks source link

Accessing the MongoDB database from VS Code on host #27

Open psychemedia opened 4 years ago

psychemedia commented 4 years ago

Connections can be made onto the MongoDB server running inside the TM351VCE container by making a couple of config changes:

After editing the server config files, the docker container will need restarting by running the following command on host: docker restart tm351VCE. (Actually, it needs running with an additional port, eg -p 35182:27017 in the original run command, which will mean killing and removing the containing and issuing a new docker run command with the additional port specified, unless we can attach additional ports to the running container or via the restart?).

Using the VS Code MongoDB extension, create a connection to localhost port 35182.

Run a query by clicking on a collection, hitting the magnifying glass / search icon, and running the the query:

image

To do: add some authentication to the mongod startup? This would then require updated connection strings in the notebooks.