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

  • Running docker container with SSH from cygwin display not working
  • Virtualbox inside Docker
  • Docker exit status 1 for Node app on AWS
  • Moving to Docker From SVN
  • Open port between docker containers
  • How does docker manage hashes for forking of docker images?
  • 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' 
        services:
          node:
            build: ./node_js
            command: node_modules/.bin/nodemon -L index.js
            command: node server.js
            depends_on:
              - mongo
            links:
              - mongo      
            environment:
              NODE_ENV: development  
            ports:
              - '8080:8080'
              - '3000:3000'
            volumes:
              - ./node_js:/home/app/chat
              - /home/app/chat/node_modules
    
          mongo:
            build: ./mongo
            ports:
              - "27017:27017"
            volumes:
              - ./mongo:/root
          nodered:
            image: jankappe/nodered
            ports:   
              - '1880:1880'
    

  • Docker virtual network interfaces are mandatory
  • Selenium: Unable to run GhostDriver(phantomJS) node on Docker Selenium Grid Setup
  • Building ASP.NET 5 with Jenkins inside a docker container
  • How to add external my.cnf file to Percona server in Docker?
  • Can't connect to Amazon RDS from Docker container
  • Postgresql and Docker
  • 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.