node.jsdockerdockerfileserve

Why my DockerFile is unable to read and write data to any directory on server even it exists, while locally working ok on my system


This is Docker File

scription here

In the above my server is unable to read and write data to any directory on server while directory exists but it shows no such file or directory open and error shows. While it's working ok on my system locally.


Solution

  • When you bind map a directory on the host into a container using -v /home/hali/Downloads/thumbnail:/src/app, the directory will be accessible inside the container on the path /src/app.

    Your program expects to find it at /home/hali/Downloads/thumbnail, so it doesn't work.

    You can fix it in two ways: