Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile.dev not working #307

Open
MichaelX99 opened this issue Nov 13, 2020 · 2 comments
Open

Dockerfile.dev not working #307

MichaelX99 opened this issue Nov 13, 2020 · 2 comments

Comments

@MichaelX99
Copy link

Hi I am starting to poke around at Notebook based workflows and discovered this very cool tool, thank you for developing it! I tried running both Dockerized routes and could not get either to work. When running the exact commands as they appear in the README for the development Dockerfile I got the following error:

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module '/app/lib/index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Please excuse me if I use the wrong terminology, I don't use Javascript and am not familiar with its tools but the reason why this is failing is because the current working directory is being mounted on top of the /app directory in the container. Unless you run yarn && yarn dev before you enter into the container then there will not be a lib subdirectory when you mount your current directory into the container. I believe this breaks a Dockerized workflow since it places added dependencies on your system besides just Docker (for example I am a Python developer and did not have yarn/node/npm on my local but I do have Docker).

The solution that I propose is to copy in the src directory along with some of the other files like package.json and then run yarn && yarn predev inside the Dockerfile so that the lib directory exists inside the image. Then when we run the container, we do not mount the entire $(pwd) but mount specific subdirectories so /app/lib is not overwritten by the blank directory on our hosts. I have a working branch ready for reviewal on my local but do not have the permissions to push to start the review.

@captainsafia
Copy link
Member

Summoning @groodt for his thoughts.

I always assumed that the *.dev Dockerfile was designed to work in coordination with a dev loop on the host machine.

@groodt
Copy link
Contributor

groodt commented Nov 23, 2020

I think this probably happened after the refactor to move to a top-level src structure in #296

@MichaelX99 The Github workflow is to fork it and then PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants