-
Notifications
You must be signed in to change notification settings - Fork 163
[Roadmap] add port check to docker compose / up #2138
Comments
So my understanding is that the network is self-contained within Docker except for any ports that are exposed. I feel like the only port that should be exposed is the 3020 one. At the moment, two other ports are exposed, which I believe is what hurt you. So if those understandings/assumptions are correct, then we just need to ensure 3020 isn't already used when running the script? |
Correct on checking the exposed port. And if possible, when running in interactive mode (not CI=1) ask the user to change, or give an actionable error.
|
@joshgoebel We ok just to expose 3020? |
Wait, what am I missing. 3035 is the webpack hosting... and 3334 is the websocket... both these things need to go all the way thru to the client so they are accessible in the browser... so it seems we need all 3 ports, no? I'm more curious how I could reproduce/detect the problem? @SleeplessByte Which OS are you on again? |
@SleeplessByte How did you get yourself in that situation? Multiple instances of the dev stack? Or is it simpler than that? |
@joshgoebel Working on a different (non-exercism) product. The port silently clashes, so assets hit Exercism for compilation. You're right about us probably needing the ports. I'll leave @SleeplessByte to help solve this! :) |
Webpack runs on port 3035 by default. That means by default this project will clash with any project using webpacker (such as any modern rails project). Because docker doesn't bind on my local IP, but 0:0:0:0, it won't actually error. That will cause the webpacker from exercism to work alongside a local isntance, making the local instance report the correct manifest, but the exercism files being available on the port, breaking everything without explanation. In reality we want to run everything on non-default ports, preferably something we can configure easily (but with non-standard defaults, just like we don't run on 3000 for rails). |
I wasn't aware that Rails itself seems to proxy requests itself thru to the dev server rather than expose it's port... so if this is indeed the case (the URL of the dev server is never handed out)... does it need to be exposed to the outside world at all - or can we just map the outside web port and web socket port? |
I've lost 2 days last weekend because of a doubly bound port. The problem is that if one service binds on "0:0:0:0" + port and one service on localhost / local ip + port, the OS will not error and get into a broken state. This is also because docker injects itself into routing files, on ipv4.
Either way.
We should have an extra script that check if ports are occupied/bound before starting the services, so we can actually bail out and error.
The text was updated successfully, but these errors were encountered: