Connections can be made onto the MongoDB server running inside the TM351VCE container by making a couple of config changes:
the container needs to be run with an additional port mapping, such as -p 35182:27017
the ${MONGODB_PATH}/bin/mongod command in the /home/jovyan/.binder/start file needs updating to include the --bind_ip_all switch (open the file to edit it using nano /home.jovyan/.binder/start from the TM351VCE terminal).
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?).
Connections can be made onto the MongoDB server running inside the TM351VCE container by making a couple of config changes:
-p 35182:27017
${MONGODB_PATH}/bin/mongod
command in the/home/jovyan/.binder/start
file needs updating to include the--bind_ip_all
switch (open the file to edit it usingnano /home.jovyan/.binder/start
from the TM351VCE terminal).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 newdocker 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
port35182
.Run a query by clicking on a collection, hitting the magnifying glass / search icon, and running the the query:
To do: add some authentication to the
mongod
startup? This would then require updated connection strings in the notebooks.