title: Runtime error in docker container, Module not found
body: <p>I am sorry for the newbie question, but I have been figuring out this error, I have an Express app and I am trying to run it as a docker container. I've used this Dockerfile:</p>
  <pre><code>FROM node:14.17.0-alpine
  COPY /src /nodejs
  WORKDIR /nodejs
  ADD package*.json ./
  RUN npm install
  
  CMD [ &quot;node&quot;, &quot;app.js&quot; ]
  </code></pre>
  <p>and this is my package.js file :</p>
  <pre><code>{
    &quot;name&quot;: &quot;server&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;app.js&quot;,
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;node app.js&quot;,
      &quot;dev&quot;: &quot;nodemon app.js -e js&quot;
    },
    &quot;keywords&quot;: [],
    &quot;author&quot;: &quot;&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;dependencies&quot;: {
      &quot;express&quot;: &quot;^4.17.1&quot;,
      &quot;express-rate-limit&quot;: &quot;^5.1.3&quot;,
      &quot;nodemon&quot;: &quot;^2.0.3&quot;,
      &quot;prom-client&quot;: &quot;^12.0.0&quot;,
      &quot;puppeteer&quot;: &quot;^10.4.0&quot;
    }
  }
  </code></pre>
  <p>I'm using windows 10 and the command I used to deploy the container is :</p>
  <pre><code>docker run --name express-api -d -p 4000:4000 docker-express-app
  </code></pre>
  <p>the error that I get after executing the above command, in power shell:</p>
  <pre><code>internal/modules/cjs/loader.js:888
  
    throw err;
  
    ^
  
  
  Error: Cannot find module '/nodejs/app.js'
  
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
  
      at Function.Module._load (internal/modules/cjs/loader.js:730: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: []
  
  }
  </code></pre>
  <p>any idea on this issue is appreciated.</p>
  <p>P.S: my project hierarchy is like so :</p>
  <p><a href="https://i.stack.imgur.com/ptlkI.png" rel="nofollow noreferrer">https://i.stack.imgur.com/ptlkI.png</a></p>