Good Afternoon!
I am relatively new to Docker, therefore I was going through the Docker tutorial.
I was attempting to start the application as described here in the tutorial:
http://localhost/tutorial/our-application/
Where I obtained the app .zip file and placed it here: C:\Users\aetay
I then built the Dockerfile as described in the tutorial:
FROM node:12-alpine
WORKDIR /app
COPY . .
RUN yarn install --production
CMD [“node”, “/app/src/index.js”]
I was able to run the dockerfile successfully and build the container image using the command:
docker build -t getting-started .
However when I attempted to start the application using the command:
docker run -dp 3000:3000 getting-started
I noticed on the Docker dashboard the error:
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module '/app/src/index.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Per troubleshooting the “index.js” file is located here: C:\Users\aetay\app\src therefore not sure what else I am missing.
Please advise.
Thanks!