He/Him

Software developer, tabletop RPG player and GM.

  • 0 Posts
  • 3 Comments
Joined 1 year ago
cake
Cake day: June 5th, 2023

help-circle
  • Ah ok I think I see some of the confusion. Docker networking is a little weird and imo compose abstracts a little too much away.
    If 2 containers are on the same docker network they are exposing all their internal ports to each other with individual virtual network adapters. This is really nice because there’s no issues with port overlap, each container has its own hostname and virtual adapter with all ports available.

    The port mapping actually binds the internal port of the container to the port on your host. This is useful for applications outside of docker to connect directly, but not necessary for anything you want behind the reverse proxy anyway.


  • Repost from kbin directly since federation is being weird.

    I use a similar setup with dockerized NPM. I see 2 things in this example that I do differently.

    1. Make sure to explicitly call out external: true in the network definition. I’m not sure what compose will do if you don’t. But I wouldn’t want it making any new proxy networks accidentally.
    2. proxy should be in the networks list for each container you want accessible from NPM. I don’t believe just defining it in the compose adds all containers to that automatically.