101-tutorial icon indicating copy to clipboard operation
101-tutorial copied to clipboard

Docker-101: Tutorial - Node Application does not open on port 3000.

Open rajBopche opened this issue 4 years ago • 9 comments

I was following the Docker 101 tutorial on the Docker Playground and reached Starting an App Container checkpoint in Our Application section.

Screenshot 2020-05-14 at 8 24 20 PM

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.

Screenshot 2020-05-14 at 8 14 22 PM

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

Screenshot 2020-05-14 at 8 15 53 PM

MacBook Pro Specs:

  1. MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)
  2. Processor 2.3Ghz Dual-Core Intel Core i5
  3. Memory 8 GB 2133 Mhz LPDDR3

OS:

  1. macOS Catalina
  2. version: 10.15.3

Google Chrome:

  1. 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 avatar May 14 '20 14:05 rajBopche

Same for me

eoiwes avatar Jun 19 '20 17:06 eoiwes

I was following the Docker 101 tutorial on the Docker Playground and reached Starting an App Container checkpoint in Our Application section.

Screenshot 2020-05-14 at 8 24 20 PM

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.

Screenshot 2020-05-14 at 8 14 22 PM

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

Screenshot 2020-05-14 at 8 15 53 PM

MacBook Pro Specs:

  1. MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)
  2. Processor 2.3Ghz Dual-Core Intel Core i5
  3. Memory 8 GB 2133 Mhz LPDDR3

OS:

  1. macOS Catalina
  2. version: 10.15.3

Google Chrome:

  1. 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.

KaushikPathak90 avatar Jul 26 '20 06:07 KaushikPathak90

Checked now.. Blank page opening with Title: Todo App

KaushikPathak90 avatar Jul 31 '20 10:07 KaushikPathak90

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)

42lan avatar Oct 30 '20 18:10 42lan

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

nikkhielseath avatar Feb 01 '21 19:02 nikkhielseath

Hi @SNikhill!

There is no more error.

Best regards. docker101

42lan avatar Feb 01 '21 20:02 42lan

Greetings, Thank you for replying. Good to know that no errors exist. :)

Regards SNikhill

nikkhielseath avatar Feb 02 '21 15:02 nikkhielseath

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

ofaurax avatar Apr 07 '21 10:04 ofaurax

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.

alexkolo avatar Oct 18 '21 23:10 alexkolo