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.

  • Docker 1.12.1: after swarm init, workers unable to join swarm
  • How to compile from a remote machine ?
  • why vagrant 1.6 + docker keep asking password for ssh connection
  • How to access docker logs of another container
  • Is there a way to remove a name from a Docker container?
  • Docker ports not exposing properly
  • Why can “docker-compose run” create files outside the container?
  • OpenVSwitch in container with IP-Tables
  • Github repo with more than one python packages
  • How do I connect the Postgres database running on the local machine to the docker container
  • Google Cloud Container: Create a docker container from a Dockerfile
  • MupX, graphicsmagick and env var
  • 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.