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.

  • Kafka on AWS ECS, how to handle advertised.host without known instance?
  • Enabling Docker Remote API on Ubuntu 14.04 with daemon startup
  • Memory snappiness docker
  • Creating BigInsights (IBM Hadoop) Docker image, sysctl issue
  • JBoss Fuse, creating container with ActiveMQ
  • Application has different appearance when running through docker
  • docker-machine osx port forwarding
  • Create shared package cache folder for a Docker container
  • Travis rebooting pretty often during runs with Docker involved
  • Connecting to a running docker container - differences between using ssh and running a command with “-t -i” parameters
  • Is it possible to access a hardware device with a docker image under Windows?
  • Execute Python script inside a given docker-compose container
  • 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.