101-tutorial
101-tutorial copied to clipboard
Docker-101: Tutorial - Node Application does not open on port 3000.
I was following the Docker 101 tutorial on the Docker Playground and reached Starting an App Container checkpoint in Our Application section.

As directed I hit the docker run -dp 3000:3000 docker-101
command and waited for 3000 badge to appear on PWD interface, but nothing happened the badge never appeared.
Instead, a very long ambiguous number appeared after the command on PWD in Docker Playground.

I even tried manually to access localhost, but all in vain.

MacBook Pro Specs:
- MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)
- Processor 2.3Ghz Dual-Core Intel Core i5
- Memory 8 GB 2133 Mhz LPDDR3
OS:
- macOS Catalina
- version: 10.15.3
Google Chrome:
- version: 81.0.4044.138 (Official Build) (64-bit)
I was never able to access the Node To-Do List Application running on port 3000.
Same for me
I was following the Docker 101 tutorial on the Docker Playground and reached Starting an App Container checkpoint in Our Application section.
![]()
As directed I hit the
docker run -dp 3000:3000 docker-101
command and waited for 3000 badge to appear on PWD interface, but nothing happened the badge never appeared.Instead, a very long ambiguous number appeared after the command on PWD in Docker Playground.
![]()
I even tried manually to access localhost, but all in vain.
![]()
MacBook Pro Specs:
- MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)
- Processor 2.3Ghz Dual-Core Intel Core i5
- Memory 8 GB 2133 Mhz LPDDR3
OS:
- macOS Catalina
- version: 10.15.3
Google Chrome:
- version: 81.0.4044.138 (Official Build) (64-bit)
I was never able to access the Node To-Do List Application running on port 3000.
@rajBopche if you have used "Play with Docker" to follow the tutorial. It is not necessary to mention your hardware details.
"waited for 3000 badge to appear on PWD interface" -> Appeared. Clicked new tab opened but no list output(app). Tried using diff browser Chrome and Firefox to check if Extensions were an issue but same result.
Checked now.. Blank page opening with Title: Todo App
The problem persists. Running container in "attached" mode shows this output:
$ docker run -p 3000:3000 docker-101
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '/app/src/index.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Checked now.. Blank page opening with Title: Todo App
Greetings, I know, my reply is too late but, if you still try to do what you did earlier and still see a blank page with the Todo App title. Can I please see the output in your browser console (like, open it up by Right Clicking and Inspect)?
Regards SNikhill
Hi @SNikhill!
There is no more error.
Best regards.
Greetings, Thank you for replying. Good to know that no errors exist. :)
Regards SNikhill
The problem persists. Running container in "attached" mode shows this output:
$ docker run -p 3000:3000 docker-101 internal/modules/cjs/loader.js:638 throw err; ^ Error: Cannot find module '/app/src/index.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Same problem here and now
Solution. To do it correctly you need to first go in the folder "/app" and create there the dockerfile, build and run it. Then it works. if you do it from root it will fail.