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?

  • Block port from the outside except for Docker
  • Docker install in user home
  • Create new MongoDB instance based on existing data
  • Local Java App not running on HBase/Phoenix Docker image
  • edit docker container files with OS X Sublime Text
  • phpMyAdmin inside docker container via nginx reverse proxy
  • Docker container http requests limit
  • PHP-Apache in Docker with only one request in the same time
  • Why use a data-only container over a host mount?
  • how to list the nodes in docker swarm via api call?
  • Docker run ignore stderr error messages
  • How to create docker registry mirror
  • 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.