I'm Implementing Docker containers for my node.js application and i'm unable to access files from a folder which are outside docker build context. How do i implement this ?
I have a 4 microservices built with node.js application. Each folder has a docker file and i have kept docker compose outside these 4 folders.
folder structure:
auth_ms -- microservice 1 with docker file
coin_zone_ms -- microservice 2 with docker file
device_ms -- microservice 3 with docker file
settings_ms -- microservice 4 with docker file
services ---- this folder is used by files present in all the above 4 microservices folder
processing ---- this folder files access files present in other microservices.
docker-compose.yml --- runs docker files present in auth_ms , coin_zone_ms , device_ms and settings_ms.
Now my issue is when i run my containers after building i:e., each image build has one of the 4 microservices, for example auth_ms which gets build and forms a container cannot access files from services folder as it is outside build context. i tried to use docker volumes but cannot attach volumes to each contains.
HOW DO I SOLVE THIS ISSUE?