simonsobs / ocs-web

Browser-rendered control panels for OCS
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Add dumb-init and revise docker instructions #10

Closed mhasself closed 2 years ago

mhasself commented 2 years ago

@BrianJKoopman -- I'm not sure why I have to change this to add hostname stuff ... let me know if you have any comments. I'll merge in a few days in any case.

BrianJKoopman commented 2 years ago

It's because you default to only serving to localhost in the run.sh script: https://github.com/simonsobs/ocs-web/blob/6ce09cb5a4da665f24c0862412fecefe23c7e863/docker/run.sh#L12-L13

When in the container and forwarding out via an option like ports: 8080:8080 you want to bind to '0.0.0.0'. My patch at the time I was checking out ocs-web initially was:

-docker run -p 8080:8080 --rm ocs-web
+docker run -p 8080:8080 --rm --env HOST=0.0.0.0 ocs-web

However, I will note that I'm doing something similar to your patch on the end to end testing setup, and I don't recall exactly why...

mhasself commented 2 years ago

When in the container and forwarding out via an option like ports: 8080:8080 you want to bind to '0.0.0.0'.

Thanks, very helpful. I've made this the default. I think you still need HOST/hostname if you're proxying; made that clearer (I hope) in the readme.

BrianJKoopman commented 2 years ago

When in the container and forwarding out via an option like ports: 8080:8080 you want to bind to '0.0.0.0'.

Thanks, very helpful. I've made this the default. I think you still need HOST/hostname if you're proxying; made that clearer (I hope) in the readme.

Ah, gotcha. Yeah, on the end to end testing setup, I have HOST=<docker-compose service name> (docker-compose will setup name resolution to the service name), and I don't set the hostname: option. But I think the suggestions you make here should work as well.