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 ?

Shubham Urolagin 1 Reputation point
2022-11-18T07:08:39.817+00:00

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?261669-auth-ms.png261660-settings-ms.png261699-coin-ms.png261754-device-ms.png261670-docker-composehalf-1.png261774-docker-composehalf-2.png261700-docker-composehalf-3.png

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,368 questions
0 comments No comments
{count} votes