Least hideous way to do this (fixing old docker mistake) reddit / selfhosted ---------------------------------------------------------------------- williamwgant · 2023-10-30 16:42 Greetings, I have a fair few docker containers running on my NAS. As I was learning docker, I made various mistakes, some of which weren't too bad to fix. However, there is one glaring, really nasty, dumb mistake I made in the beginning which I'd like to correct. All of my docker containers are on the same network and have the same address range (192.168.10.128-192.168.10.254). They are currently all hardcoded. In general, other than a couple things (my instance of pihole, and nginx proxy manager), I believe that most things would be better served with dynamic IPs, mainly because this gets rid of one more thing I have to track. They also don't really have to have IPs visible outside the docker environment at all, since all of them are referenced by container name from nginx proxy manager. I figure the stuff that needs to remain static can just be moved to a static address less than 128. But what's the least awful way to move the rest? All my docker compose files are stored in a git repo and are set up in portainer to check for updates every 10 minutes or so. Would it be best to just bulk update everything and let portainer take care of it or will that bust a bunch of stuff. How would you do it without pulling your hair out if you were me? ---------------------------------------------------------------------- csakegyszer · 2023-10-30 17:51 I would choose the least important (no pain if it is not running for days) and easy to build / start (less waiting time) service. If you have it then you can start to play. If you have the working solution apply it on the next service. Once you are done with all services then do the cleanup. ---------------------------------------------------------------------- Spuxilet · 2023-10-30 20:13 I did it like this. Stop all the containers. Created small bash script to create different networks for different services. The only 2 containers that needed static ips i set them up in compose file. I created network for each compose file. For example \*arr services in one network, nextcloud with it's database in other and so on. Then i put traefik in all the networks i created and this way services are isolated from each other and i can reach all of them using reverse proxy :) If anyone knows better solution please reply. ---------------------------------------------------------------------- adamshand · 2023-10-30 20:14 Do it one container at a time, until you've figured out any gotchas and know your process works. Then update the remaining containers all at once. Side note, nothing should need a static docker IP. Containers can refer to each other by their container_name. For PiHole and Nginx, the container IP doesn't matter, queries go to the server's IP and get to the service via the mapped ports. ---------------------------------------------------------------------- williamwgant · 2023-10-31 10:24 Yeah, I didn't know I could map by the container name in pihole. I knew I could do it in nginx. That may change some things as well. ---------------------------------------------------------------------- williamwgant · 2023-11-01 13:29 I ran into problems almost immediately. While nginx proxy manager is set up to refer to the containers by their hostname, removing the static IP addresses from the host caused bad gateway errors to be generated. Everything fell over and I had to revert. I'm not sure what's going on yet, but I've added another thread for that particular discussion: [https://www.reddit.com/r/selfhosted/comments/17lblro/strange\_nginx\_ proxy\_manager\_issue/](https://www.reddit.com/r/selfhosted/comments/1 7lblro/strange_nginx_proxy_manager_issue/)