[Dachs-support] Pb redirecting DACHS from port 80 (container) to port 8005(host)
Markus Demleitner
msdemlei at ari.uni-heidelberg.de
Mon Sep 24 13:37:40 CEST 2018
Hi again,
On Mon, Sep 24, 2018 at 11:37:52AM +0200, Carlos Brandt wrote:
> Yes, it is exactly what Markus had already figured out (and was not
> crystal clear to me).
>
> 1) As Markus said, you have to effectively define "localhost:8005" in
> DaCHS/GAVO settings;
> 2) Also, your container must now EXPOSE 8005;
> 3) And you'll want to bind host's 8005 to container's 8005 (-p8005:8005).
Uh, you *can* do that, but you don't *have to*. The port DaCHS
listens to is independent of what serverURL says, and that's by
design, exactly because there's all kinds of proxing solutions.
Applied to the docker case, there's relatively simple rules
(disclaimer: I've not tried them, I'm working from the Docker
documentation here):
(a) if you give EXPOSE, it needs to be what's in [web]port, and
[web] serverURL needs to include that port (unless it's 80 or
443, obviously)
(b) if you give a -p x:y option to Docker (and I understand from the
documentation that that's an alternative to EXPOSE), then x needs
to be in [web]serverURL (unless 80 or 443), and y needs to be in
[web]port.
For (b), that's based on the documentation's claim that -p's
arguments are hostPort:containerPort; if I'm misreading what they're
saying here, swap x and y.
-- Markus
PS: Sorry for not trying things and trusting on documentation, but
the only machine I allow Docker on is a crappy, noisy box I
specifically have to wake up to play with (or run regression tests).
More information about the Dachs-support
mailing list