i watched a few presentations about LXC/LXD and i was very excited and interested about the project.
To get a little bit of practice and more familiar with it, i would like to migrate all the services of my cloud server to another server where every essential service should be isolated in its own container.
Let me get into a little bit more detail what i have in mind here:
I have deployed various services (bare-metal) on a single host at the moment .(e.g seafile, bitwarden)
Many of those services rely on a webserver or maybe an sql database.
I would like to isolate those services in seperate containers, so for example:
Container 1 = Bitwarden
Container 2 = Seafile
If i follow the example above i would likely end up installing multiple instances of a webserver or an sql database, so that every “core app” is pretty much completly isolated from its environment (much like you would do in a single virtual machine) This approach seems a little bit redundant and not very efficient, so the other idea would be to put nginx and sql in a seperate container (for example c1-nginx , c2-sql) and let the “core app” containers communicate with c1-nginx and c2-sql.
If i have multiple instances of nginx running, how do i make sure that a request for bitwarden.mydomain.com goes to the right container whereas a request for seafile.mydomain.com goes to another? (i assume via a reverse-proxy?)
If i put nginx in a sperate container i probably don`t need to worry about that but then i need to make sure that my containers can communicate with each other.
I guess i am trying to figure out how to appraoch this “the right way” at the moment and i am grateful for any helpful advice.