Using docker-compose network to give a service a fixed IP address

Hello Ollie,

you didn’t mention if you are running a windows-box (with windows-containers or linux-containers) or on a linux-box.
I’ve tested on my linux box and was able to ping a container within my bridge-network by its IP-address.
Whereas on my windows-box running linux-containers I was not able to do so. See Networking features in Docker Desktop for Windows | Docker Documentation for more information.

But usually it is not needed to have fixed ip-addresses for your containers. Let Docker decide which ip to use for which container and simply use port-mapping and/or the container’s names to access one container from another container.

Best regards
Matthias :slight_smile: