cenk1cenk2/nginx-ingress

By cenk1cenk2

Updated 7 months ago

Load balances multiple docker containers through Nginx streams.

Image

416

docker-nginx-ingress

pipeline statusDocker PullsDocker Image Size (latest by date)Docker Image Version (latest by date)GitHub last commit

Description

Nginx ingress controller for docker-compose stacks, where it takes in a JSON environment variable for the defined containers and load-balances them through streams of Nginx.

Setup

You can run this application as a docker-compose stack. The image is hosted as cenk1cenk2/nginx-ingress on DockerHub. Check out the docker-compose file for example configuration.

Environment Variables

NGINX_INGRESS

The environment variable NGINX_INGRESS is an array of objects in the JSON form to define the endpoints and load-balanced containers.

[
  {
    "server": {
      "listen": "string", // listen port and type for endpoint
      "options": {
        // key-value pairs of options that should be passed to "server" configuration of Nginx
      }
    },
    "upstream": {
      "servers": [
        // string slice of balanced servers
      ],
      "options": {
        // key-value pairs of options that should be passed to "upstream" configuration of Nginx
      }
    }
  }
]
Flag / EnvironmentDescriptionTypeRequiredDefault
$NGINX_INGRESSThe configuration for the ingress operation of Nginx.String
json({ server: struct { listen: string, options: map[string]string }, upstream: struct { servers: []string, options: map[string]string } })
true
CLI
Flag / EnvironmentDescriptionTypeRequiredDefault
$LOG_LEVELDefine the log level for the application.String
enum("panic", "fatal", "warn", "info", "debug", "trace")
falseinfo
$ENV_FILEEnvironment files to inject.StringSlicefalse

Docker Pull Command

docker pull cenk1cenk2/nginx-ingress