|
Hello all. I just tried to stand up a dozzle interest in my dev env in hopes to make my life a little easier. Seeing it uses the socket to connect and I just went through a round of hardening on my box, I do not expose the socket to any service anymore except a proxy. I was able to get this somewhat working using your documentation, but was hoping there was a way for me to tell Dozzle to only use a socket proxy running locally on that node. This would permit local access to the local socket. Currently it appears to query and let the swarm LB determine which container it will land on. I do not get full representation of the cluster and have some other behaviors that I am betting are related. I played with this yesterday and could not get it working. Wondering if anyone has a working config like this involving both a socket proxy and a Swarm cluster in Docker. thanks for any insights. |
Replies: 2 comments 14 replies
I am not sure what this means. Just set up a proxy and point Dozzle to it as documented.
What is it? Dozzle on swarm needs to get deployed on every node in swarm. They all communicate together to accurately represent all the containers in the cluster. Dozzle doesn't use swarm API as it is unstable and doesn't work. I would recommend first setting up Dozzle without any proxies and then moving to proxy. If there are any bugs without proxy then I think it's worth opening issues so I can see if they are really bugs. If something doesn't work with a proxy, then you'll need to investigate yourself as it is outside of my scope to support all proxy types out there. If something is missing in the docs, then a PR would be appreciated. Finally, when asking for help, it would be best to share all your configuration. |
|
According to ChatGPT. These are your options: You're absolutely correct! When a container connects to Host Network Mode (Corrected)When using version: '3.8'
services:
proxy:
image: your-proxy-image
network_mode: host # Shares host network
deploy:
mode: global
app:
image: your-app-image
network_mode: host # Also shares host network
environment:
- PROXY_URL=http://localhost:8080 # This works because both use host network
deploy:
mode: globalPublished Ports (Most Common Solution)For containers with default bridge/overlay networks, you need to connect to the host IP: version: '3.8'
services:
proxy:
image: your-proxy-image
ports:
- "8080:80" # Published to host
deploy:
mode: global
app:
image: your-app-image
environment:
# Connect to host IP, not localhost
- PROXY_URL=http://host.docker.internal:8080 # Docker Desktop
# OR discover host IP dynamically (see below)
deploy:
mode: globalUsing Docker's Special DNS NamesIn newer Docker versions, you can use special hostnames: version: '3.8'
services:
proxy:
image: your-proxy-image
ports:
- "8080:80"
deploy:
mode: global
app:
image: your-app-image
environment:
# These work in some Docker environments
- PROXY_URL=http://host.docker.internal:8080 # Docker Desktop
# OR
- PROXY_URL=http://gateway.docker.internal:8080
deploy:
mode: globalUnfortunately, I don't think any of these are great ideas. It seems that swarm mode with proxy is not a good option. This isn't a problem with Dozzle so there isn't anything I can do. |
I did some reading last night. I am afraid this is not possible. Swarm services can only communicate with other services. You can use
network_mode: hostbut I wouldn't recommend it.Your best option is to set up each node manually with one central UI.
I have updated the documentation to reflect this.