Q: Docker container joining existing network with fixed ip (via docker compose) - eviltoast

Hi, I figured out how to get docker containers to join an existing network with putting “networks” into the respective sections of the docker-compose.yml

If I want to also give them fixed ip’s on this network, what would the syntax look like in the docker-compose.yml?

  • NewDataEngineer@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    What I haven’t figured out yet is whether or not I can give my docker services their own IP on my router for access from another system on a fixed or reserved IP.

    You can. You have to set up a macvlan on your network and then assign an IP to your container that sits on your router’s subnet.

    I can only use traefik with a macvlan because Synology DSM uses ports 80 and 443. I assign traefik its own IP and use pihole’s DNS to route wildcard subdomain to it.

    I wrote a guide in my trillium notes. If you’re interested I can share.