I’ve got jellyfin and nginx proxy manager running in two separate containers. What do I need to specify in known proxies? The ip is changing frequently which means I can’t use it.
I try setting the ip in the compose file but something is wrong. nginx proxy manager:
22 networks: 23 npm: 24 ipv_address: 172.20.0.2 25 26 networks: 27 npm: 28 driver: bridge 29 ipam: 30 config: 31 - subnet: 172.20.0.0/24 32 gateway: 172.20.0.1 33
and
jellyfin:
32 networks: 33 npm: 34 ipv_address: 172.20.0.3 35 36 networks: 37 npm: 38 driver: bridge 39 ipam: 40 config: 41 - subnet: 172.20.0.0/24 42 gateway: 172.20.0.1
can someone point me into the right direction?
chiisana@lemmy.chiisana.net 9 months ago
Last time this was asked, I’ve voiced the concern that tying fixed IP address to container definitions is an anti-pattern, and I’ll voice that again. You shouldn’t be defining a fixed IP address to individual services as that prevents future scaling.
Instead, you should leverage service discover mechanisms to help your services identify each other and wire up that way.
It seemed like in NPM, there is no fitting mechanisms out of the box. Which may suggest your use case is out growing what it may be able to service you for in the future. However, docker compose stacks may rescue the current implementation with DNS resolution. Try simplifying your npm’s docker compose to just this:
And your jellyfin compose with something like:
Have your other services in Jellyfin stack stay only on jellyfin_net or whatever you define it to be, so they’re not exposed to npm/other services. Then in the configs, have your npm talk direct to the name of your jellyfin service using hostname, maybe something like
jellyfin
or whatever you’ve set as the service name. You may need to include the compose stack as prefix, too. This should then allow your npm to talk to your jellyfin via the docker compose networks’ DNS directly.Good luck!
steersman2484@sh.itjust.works 9 months ago
I agree on your take, but I don’t think that “future scaling” is a concern for the most home users.
chiisana@lemmy.chiisana.net 9 months ago
It may not affect this current use case for a home media server, but people should still be aware of it so as they learn and grow, they don’t paint themselves in a corner by knowing only the anti patterns as the path forward.
barbara@lemmy.ml 9 months ago
Thank you! I’ll have a look into it