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?

  • GPU becomes unavailable when computer goes to sleep
  • Docker with third party software
  • Cannot access Centos sshd on Docker
  • Enabling Remote API in Docker on Mac OS X (boot2docker)
  • Null port bindings from inspect, the first time. a second time good. why?
  • Docker-compose extra_hosts on Mac
  • Boot a docker container from PXE
  • Docker private registry with multiple registry urls using nginx
  • How to run grunt-connect within docker container
  • Can I use docker to provide a simple file overlay over my current system?
  • ERROR - Docker-compose/docker Windows
  • How to do a custom deploy using ssh with Travis CI?
  • 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

    Flynn PaaS

    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!


    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.