Closed sbach closed 6 years ago
Thanks for digging into this @sbach! I just want to note that I'm travelling for the next few weeks so it may take me a while before I can look at this in any detail, but I'm definitely interested in following up.
Bad state of my networking stack made that work. 631
isn't the required port.
@rfk I will investigate more and come with a real fix. Will re-open at that time.
Using tcpdump
and strace
, I validated this is not an issue of unpublished port and discovered that requests aren't received by gunicorn
.
As gunicorn
is listening on localhost:5000
(see README.rst
) it is not binding to the container's IP address. That said, it will not receive requests from the outside. Using gunicorn --bind 0.0.0.0:5000
should be a safe fix.
I have updated my branch at: https://github.com/sbach/syncserver/tree/fix/docker
@rfk Can you validate the updated Docker command works on you side? I could then open a proper PR.
@sbach thanks, yes, it looks like this change should work. We recently found a similar issue with a trial docker deployment in production.
The official
README.rst
uses--network host
thus giving the container full access to the host's networking. The following-p 5000:5000
thus becomes unnecessary.After quick investigation, I would like to offer a different solution (note: the use of
--network
comes from #90).Here are the ports used by the container:
After isolating the required ports to be exposed (by changing the
bind
IP address) it looks like we only need5000
and631
. However, I have yet to determine which piece of code listen on631
.The first commit of this PR only cleanup the Docker command so it can be pasted in a shell without error(s).