I'm running multiple Docker Compose deployments on various Linux machines, and I'm looking to connect them within a single network. However, I want to keep the deployments independent across different servers and not use any orchestration tools like Swarm or Kubernetes. I'm curious about the best methods to achieve a single network visibility for certain Docker instances, while still allowing for separate deployments. Any advice would be appreciated!
3 Answers
It sounds like you're trying to achieve something Docker isn't really designed for without orchestration. One option is to use the `network_mode: host` configuration. This way, your containers can connect to each other like regular hosts, but you'll have to manage the network setup manually outside of Docker. Just be aware that this approach might complicate things a bit.
If you're not keen on orchestration tools, maybe look into setting up a macvlan network. This would allow you to create a shared VLAN ID between your hosts, but you'll need to handle the external network controls yourself.
Vxlan could also be an option here to consider, especially if you're looking for something more flexible!
Using a reverse proxy can help too! If each server has its own service running, consider using something like Nginx or HAProxy to manage the traffic across those servers. This could give you a clearer flow for external access while maintaining individual deployments.
Yeah, I agree! It's definitely a bit of networking work outside of Docker if you go that route.