How to build multi tenant application using docker

I am pretty much new to the docker concept and know basics of it.
I just wanted to know how can we build multi tenant application using docker.
Where the containers will use the local hosted database with different schema.With the nginx we can do reverse proxy but how we can achieve it?
because every container will be accessed by localhost:8080 and how we can add upstream and server part.
It will be very helpful if some one explains it to me.

  • How to build a Docker container for JAVA web application
  • Docker Java number of available CPU cores
  • Including data in MySQL Docker container
  • Expose a random port
  • Use Docker, Gunicorn, Nginx in django development environment but can only see nginx welcome page?
  • jBPM-Workbench-Showcase docker image: internal git accessing/ clone function does not work
  • Running flask app with docker & kubernetes
  • Building a Docker Image results in error while trying to install libwww-perl i.e., perl-modules_5.14.2-6 and perl_5.14.2-6 Not found
  • Docker Swarm vs. Docker Cluster
  • Using docker-compose with CI - how to deal with exit codes and daemonized linked containers?
  • How to have a scaleable docker cluster with a reverse proxy and load balancer serving several sites from one VM
  • Can't run gdbserver in a Docker container for the Visual C++ for Linux Development
  • One Solution collect form web for “How to build multi tenant application using docker”

    If I understand correctly you want processes in containers to connect to resources on the host.

    From you containers perspective in bridge mode (the default), the host’s IP is the gateway. Unfortunate the gateway IP address may vary and can only be determinate at runtime.

    Here are a few ways to get it:

    • From the host using docker inspect: docker inspect <container name or ID>. The gateway will be available under NetworkSettings.Networks.Gateway.
    • From the container you can execute route | awk '/^default/ { print $2 }'

    One other possibility is to use --net=host when running your container.
    This will run you processes on the same network as your processes on your host. Doing so will make your database accessible from the container on localhost.

    Note that using --net=host will not work on Docker for mac/windows.

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