Reddit – Dive into anything

I have created several containers that are all on the same network and wanting to create a compose file that will restart them all and update as needed. I have discovered that you can easily select the network by:

networks:
    - network_name

However, I would also like to add a Hostname. I was having issues with the containers talking to each other until I changed the 192.168.0.0:8888 to container.local:8888.

I have seen some compose files that are structured as such:

networks:
   network_name:
      ipv4_address: 192.168.0.0

and I was wondering if simply putting the container.local in place of 192.168.0.0 would suffice.

I created the network in portainer and my next step is to incorporate the network into a compose file or even add it to the whole compose file for these containers. It is relatively easy to manipulate it in portainer but I would like to have one compose file to manage them all in the future.