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

Don't expose port 8080 by default #199

Open
mcandre opened this issue Dec 14, 2018 · 3 comments
Open

Don't expose port 8080 by default #199

mcandre opened this issue Dec 14, 2018 · 3 comments

Comments

@mcandre
Copy link

mcandre commented Dec 14, 2018

Many Node.js applications use a different port (e.g., React.js assumes 3000), or even avoid using networking altogether (e.g., Node.js CLI tools). I think the benefits of assigning a default port mapping are slim compared to the downsides of collision for different kinds of Node.js project configurations.

One workaround for downstream images is to reconfigure applications to match port 8080. Another workaround is to open up both 8080 and the other ports (unfortunately, Docker does not currently have a way to un-EXPOSE ports). Ultimately, it would be cleaner to not assume any particular network port configuration and leave that up to downstream developers to decide.

@der-ali
Copy link

der-ali commented Apr 17, 2019

i had also this problem. I set therefore an env in the app to configure the port. Openshift exposes port 8080 as a default port for the routes.

@ryanj
Copy link
Contributor

ryanj commented May 14, 2021

Try using the PORT env var. You should be able to set PORT=3000

@phracek
Copy link
Member

phracek commented Sep 12, 2023

@mcandre @der-ali After setting PORT env var, is the container working properly? If so, please close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants