Giter Site home page Giter Site logo

docker-proxy's Introduction

Supported tags and respective Dockerfile links

docker-proxy

Nginx proxy that maps containers to subdomains.

Use the regular tagged version to map docker containers to subdomains by their name.

Example: Container solid is mapped to solid.example.org. The containers public port is mapped to the port specified via PROXY_PORT.


Use the ios tagged version for the setup used in the iOS Praktikum at TUM to map container compositions to the composition prefix.

Example: Containers from a docker composition liquid_node_1 and liquid_db_1 are mapped to liquid.example.org. The container's private ports are mapped to the new subdomain if a public mapping exists, respecting docker-proxy's published port range. So the first public port of liquid_node_1 is available at liquid.example.org:80, the second at liquid.example.org:81 etc.

The ios-pers tagged version makes port mappings persistent, so they stay the same after adding or removing containers.


Important: Make sure that your DNS is configured in a way that all subdomains of the given hostname point to your docker host.

Usage

Run the docker-proxy container using the following command:

Regular Version

docker run -it --rm --name docker-proxy -p 80:80 -v /var/run/docker.sock:/var/run/docker.sock -e PROXY_PORT=80 -e PROXY_BASE_URL=example.org herzog31/docker-proxy:regular

iOS Version

docker run -it --rm --name docker-proxy -p 80-100:80-100 -v /var/run/docker.sock:/var/run/docker.sock -e PROXY_PORT_RANGE=80-100 -e PROXY_BASE_URL=example.org herzog31/docker-proxy:ios

Replace example.org with the desired hostname and configure your DNS accordingly.


To let the container run as a daemon, use the following command:

Regular Version

docker run -d --name docker-proxy --restart=always -p 80:80 -v /var/run/docker.sock:/var/run/docker.sock -e PROXY_PORT=80 -e PROXY_BASE_URL=example.org herzog31/docker-proxy:regular

iOS Version

docker run -d --name docker-proxy --restart=always -p 80-100:80-100 -v /var/run/docker.sock:/var/run/docker.sock -e PROXY_PORT_RANGE=80-100 -e PROXY_BASE_URL=example.org herzog31/docker-proxy:ios

Port Mappings Overview

The proxy provides an overview table at example.org:80 that shows all port mappings.

Variables

Variable | Function --- | --- | --- PROXY_BASE_URL | Hostname that will be used, e.g. example.org PROXY_PORT | Public port that will be mapped to the ports from the containers. Only applicable for the regular version. PROXY_PORT_RANGE | Public ports that will be mapped to the ports form the containers. Only applicable for the ios version.

docker-proxy's People

Contributors

herzog31 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.