Open mcandre opened 5 years ago
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.
Try using the PORT
env var. You should be able to set PORT=3000
@mcandre @der-ali After setting PORT env var, is the container working properly? If so, please close this issue.
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.