I currently have the following services in a dynamic file config
services:
web-service:
loadBalancer:
servers:
- url: "http://172.23.0.3:80"
api-service:
loadBalancer:
servers:
- url: "http://172.23.0.2:8911"
I am using a static config of
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
file:
filename: "traefik_dynamic.yml"
watch: true
These IPs are docker IPs to services running.
web:
build:
context: .
dockerfile: ./deploy/Dockerfile.nginx
networks:
- proxy
Everything works as expected. However, sometimes I find when I restart the docker services using compose, or down compose down and then up. Then the IPs change.
Is there a more reliable way to address these services?
Note: I am not keen on using labels. Some labels are OK, but I don't want to convert my whole setup to docker labels because IMO - it looks really messy.