-
We will use a Dozzle as our example. Its
docker-compose.ymlfrom its website is something like this:services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - 8080:8080
To use it as a reverse proxy or a load balancer endpoint, add the
fpm-networkdocker network to the dozzle container:services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock networks: - fpm-network networks: fpm-network: external: true
Notice that the
fpm-networkis defined in thedocker-compose.ymlfile. This is the same network defined in the docker-compose.yml file.We also removed the
portssection from thedozzlecontainer. This is because ourferronservice in the docker-compose.yml is connected to thedozzleservice via thefpm-networknetwork. Now you can create a reverse proxy by usinghttp://dozzle:8080as the backend URL in the Ferron Proxy Manager web UI.A screenshot of the Ferron Proxy Manager web UI with the necessary configuration for a reverse proxy is shown below:
You can use the same backend url for a load balancer.
-
For docker compose files with multiple services, attach the
fpm-networkto the service that you want to connect to the reverse proxy or load balancer. This is typically the service which exposes a web UI or the one which you want to be publicly accessible.
