Mongodb is not started. How to write in Dockerfile to start mongodb
DockerfileIt is only used to build a mirror image, and eventually it needs to pass through
docker runTo start the container, otherwise it will not run automatically.
In addition, look at your screenshot, you also did not put
mongodbConnection of container to
node.jsIn the container (I don’t know if you put these two programs in a container inside), I suggest you take a look.
docker runhit the target
--linkThis parameter is related to the introduction.