/docker-nginx-ingress

An ingress controller for docker-compose stacks via using stream functionality of Nginx.

Primary LanguageGo

docker-nginx-ingress

pipeline status Docker Pulls Docker 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 / Environment Description Type Required Default
$NGINX_INGRESS The 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 / Environment Description Type Required Default
$LOG_LEVEL Define the log level for the application. String
enum("panic", "fatal", "warn", "info", "debug", "trace")
false info
$ENV_FILE Environment files to inject. StringSlice false