Auto dockers containers by subdomain
I want to implement a SaaS schema and I need to solve an important part of its operation. My idea is to use docker containers configured according to the subdomain that is accessed. The variables of these containers are designated according to data stored in a database.
I have two possible approaches: Start and stop containers on demand through a proxy. One container per subdomain. Or a single container, and that the application is the one that changes the configuration according to the subdomain from which the request comes.
Which ones do you recommend? Is there any solution already worked out?
One Solution collect form web for “Auto dockers containers by subdomain”
If I understand what your asking you want a PaaS a lot like heroku to manage apps running on a given domain? Rather than rolling your own logic for all of this I would take a look at Dokku. It’s a small PaaS implementation which deploys apps to a given subdomain via a git push + a Dockerfile.
Dokku – Small PaaS based on Docker
Another option would be Flynn but this is a lot heavier
If your looking for your own implementation the Automated Proxy by jwilder would be a good image to use. It automatically configures a proxy to pass requests to a given subdomain based on a VIRTUAL_HOST and VIRTUAL_PORT env set on your app containers
jwilder Automated Proxy
Hope this helps!