I am using Docker to run four containers to run a backend web application. The backend web application uses buildout to assemble the software.
However, the frontend, which is installed and runs on the host machine (that is, not using Docker), needs to access the buildout directory inside one of the four docker containers.
Moreover, the frontend uses an environment variable called NTI_BUILDOUT_PATH that is defined on the host machine. NTI_BUILDOUT_PATH must point to the buildout directory, which is inside the aforementioned container.
My problem is that I do not know how to define NTI_BUILDOUT_PATH such that it contains a directory that points towards the buildout directory that is needed by the front end for SSL certificates and other purposes.
I have researched around the web and read about volumes and bind mounts but I do not think they can help me in my case.
One way you can do that is by copying your
buildoutfolder into the host machine usingdocker cpFor Example if your backend's container_id is d1b5365c5bca and your
buildoutfolder is in/app/buildoutinside the container. You can use the following command to copy it to the host.After that you
docker rmall your containers and recreate new ones with abind mountto the buildout folder in the host. So following the previous example we'll have