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

How to expose and run Node.js app / No Documentation #1727

Closed
dendihandian opened this issue Jul 23, 2018 · 11 comments
Closed

How to expose and run Node.js app / No Documentation #1727

dendihandian opened this issue Jul 23, 2018 · 11 comments
Labels

Comments

@dendihandian
Copy link

Info:

  • Docker version ($ docker --version): 18.03.1-ce, build 9ee9f40
  • Laradock commit ($ git rev-parse HEAD): 85c57a0
  • System info (Mac, PC, Linux): Linux
  • System info disto/version: Ubuntu 18.04 LTS

Issue:

No documentation to access running nodejs app in local machine browser

Expected behavior:

There are explanation or guide in official laradock documentation to run (maybe expose a port) nodejs app.

Reproduce:

run any nodejs app server via npm run dev or yarn dev command. And It must be cannot be accessed in localhost:3000 / 0.0.0.0:3000 / {docker-host}:3000

Relevant Code:

// place a code sample here
@CrediMarketIT
Copy link

+1. I facing the same problem. Trying to expose 3000 or add port 3000:3000 on workspace container but no luck, localhost:3000 still returns 'this site can't be reached'.
Anyone know how to set this up?

@zuohuadong
Copy link
Contributor

The workspace is not suitable for running the node.js program, but I can add it if needed.

@zuohuadong
Copy link
Contributor

see: #1821

@zuohuadong zuohuadong mentioned this issue Sep 28, 2018
3 tasks
@Denis00211
Copy link

Denis00211 commented Oct 2, 2018

I changed the port to 3003 and rebuilt the workspace container, it helped me

@llioor
Copy link

llioor commented Jan 23, 2019

@Denis00211 and @zuohuadong ... can u please advice...?
Please check the print screens:
screenshot-0 0 0 0-3300-2019 01 23-19-12-27
screenshot-0 0 0 0-3300-2019 01 23-19-11-56
screenshot-localhost-3300-2019 01 23-19-35-28

@ezra-obiwale
Copy link

@llioor Need more clarifications, please.

  1. Vue 2 or 3?
  2. You can access the dev server from the host?
  3. Hot reload works?

@llioor
Copy link

llioor commented Jan 24, 2019

@ezra-obiwale Hi Ezra... I'll be happy to help you.

  1. I'm working with react and not Vue.. I don't think it matters.
  2. I can access the dev server from localhost:3300 (as u see I changed the port in the webpack "devserver" setting because I'm running another container which listen to port 3000).
  3. Hotreload works!

Basically u need to change in the "devServer" setting this:

  1. port: 3300
  2. host: 0.0.0.0
  3. Then in the docker-compose.yml file I added this line under the workspace section:
ports:
        - "${WORKSPACE_SSH_PORT}:22"
        - "3300:3300" 
  1. Then I re-build the workspace
  2. Then run the sever and go to http://localhost:3300

@juanjosv
Copy link

@ezra-obiwale Hi Ezra... I'll be happy to help you.

  1. I'm working with react and not Vue.. I don't think it matters.
  2. I can access the dev server from localhost:3300 (as u see I changed the port in the webpack "devserver" setting because I'm running another container which listen to port 3000).
  3. Hotreload works!

Basically u need to change in the "devServer" setting this:

  1. port: 3300
  2. host: 0.0.0.0
  3. Then in the docker-compose.yml file I added this line under the workspace section:
ports:
        - "${WORKSPACE_SSH_PORT}:22"
        - "3300:3300" 
  1. Then I re-build the workspace
  2. Then run the sever and go to http://localhost:3300

And how to add this to a running dockerized apache o nginx?
Can we add a site and map for example to localhost/appnode?

@DungBuiDeveloper
Copy link

same question for laradock please.

@stale
Copy link

stale bot commented Apr 8, 2020

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs. Thank you for your contributions ❤️.

@stale stale bot added the Stale label Apr 8, 2020
@stale
Copy link

stale bot commented Apr 29, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants