Node.js docker container runs when folder is located on desktop but wont in C drive

I have a multi-container setup that I start with a docker-compose file. Everything works fine until I replace my setup to any folder in my C drive.

For example;
When i call ‘docker-compose up’ here it works fine: C:\Users\me\Desktop\PrototypeEnvironment\Software\DataSearch

  • How to link from docker-compose to Amazon RDS
  • Error while is docker pull image
  • Docker RUN statement (modifying a file) not executed
  • Docker and OpenStack Benchmarking
  • Containerization pattern best practice
  • How to Mount Hugepages inside Docker
  • And it doesn’t work here: C:\test

    node_1     | module.js:327
    node_1     |     throw err;
    node_1     |     ^
    node_1     |
    node_1     | Error: Cannot find module '/home/app/chat/server.js'
    node_1     |     at Function.Module._resolveFilename (module.js:325:15)
    node_1     |     at Function.Module._load (module.js:276:25)
    node_1     |     at Function.Module.runMain (module.js:441:10)
    node_1     |     at startup (node.js:134:18)
    node_1     |     at node.js:962:3
    trunk_node_1 exited with code 1

    I’m using the Docker toolbox for windows
    Does anyone have any idea why this happens. If you need more information please ask. Thanks in advance.

    Docker-compose file:

        version: '2' 
            build: ./node_js
            command: node_modules/.bin/nodemon -L index.js
            command: node server.js
              - mongo
              - mongo      
              NODE_ENV: development  
              - '8080:8080'
              - '3000:3000'
              - ./node_js:/home/app/chat
              - /home/app/chat/node_modules
            build: ./mongo
              - "27017:27017"
              - ./mongo:/root
            image: jankappe/nodered
              - '1880:1880'

  • Is there any point in Dockerizing a remote Git repository?
  • Unable to create docker virtual machine
  • Play framework running inside docker not accessible from localhost
  • what is Server error: Status 0 while fetching image layer
  • Web Server and Database Server in a Docker Container
  • How to interact with Docker daemon directly (bypass the terminal) through Java program
  • One Solution collect form web for “Node.js docker container runs when folder is located on desktop but wont in C drive”

    Docker has a problem when you are not using C:\Users\{your_user} folder for you project location, because other folders (not from C:\Users\{your_user} folder) are some kind out of the scope of Docker. For example if I put my project in C:\my_porject then volumes from docker-compose.yml are not working. And when I put the same project somewhere inside C:\Users\{my_user}\my_porject folder (or any subfolder of user root folder) then volumes are working.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.