In outside-access docker-compose, I need to access vpn:8000 within a local network.
|
command: sh -c "curl 'https://api.ipify.org?format=json' && curl -v 'http://vpn:8000/'" |
I can access it from host by vpn's ip, like 172.17.0.2:8000 if I publish port on vpn as 8000:8000. But it is not reachable from local network if OpenVPN is setup in it. You can try this on https://labs.play-with-docker.com with your docker compose. vpn:8000 will not be accesible from the internet.
I am not very familiar with ip routing, so I am not sure what is going on. I can make it work adding another container with 8000 as published port and using socat to forward that port to vpn:8000 (example). But is there any native docker way to do it?
In outside-access docker-compose, I need to access
vpn:8000within a local network.docker-openvpn-client/examples/outside-access/docker-compose.yml
Line 54 in 258069b
I can access it from host by
vpn's ip, like172.17.0.2:8000if I publish port onvpnas8000:8000. But it is not reachable from local network if OpenVPN is setup in it. You can try this on https://labs.play-with-docker.com with your docker compose.vpn:8000will not be accesible from the internet.I am not very familiar with ip routing, so I am not sure what is going on. I can make it work adding another container with
8000as published port and usingsocatto forward that port tovpn:8000(example). But is there any native docker way to do it?