Couper is a lightweight API gateway designed for building and operating API-driven Web projects.
50K+
Couper is designed to support developers building and operating API-driven Web projects by offering security and observability functionality in a frontend gateway component.
For additional information, tutorials and documentation, please visit the Couper repository.
Couper requires a configuration file which has to be provided on start. See our documentation on how to configure Couper.
This image contains a basic configuration to serve files from /htdocs directory.
$ docker run --rm -p 8080:8080 -v `pwd`:/htdocs coupergateway/couper
The entrypoint of the image is the /couper binary. The command is run.
Therefore docker run coupergateway/couper runs /couper run -d /conf.
The directory argument allows you to mount multiple configuration files to the /conf directory.
You could also use other commands directly:
$ docker run coupergateway/couper version
$ docker run coupergateway/couper run -watch -p 8081
| Variable | Default | Description |
|---|---|---|
| COUPER_BIND_ADDRESS | "*" | A comma-separated list of addresses to bind. |
| COUPER_FILE | couper.hcl | Path to the configuration file. |
| COUPER_FILE_DIRECTORY | "" | Path to the configuration files directory. |
| COUPER_DEFAULT_PORT | 8080 | Sets the default port to the given value and does not override explicit [host:port] configurations from file. |
| COUPER_ENVIRONMENT | "" | Name of environment in which Couper is currently running. |
| COUPER_WATCH | false | Set to true to watch for configuration file changes. |
| COUPER_WATCH_RETRIES | 5 | Maximal retry count for configuration reloads which could not bind the configured port. |
| COUPER_WATCH_RETRY_DELAY | 500ms | Delay duration before next attempt if an error occurs. |
| Variable | Default | Description |
|---|---|---|
| COUPER_HEALTH_PATH | /healthz | Path for health-check requests for all servers and ports. |
| COUPER_LOG_FORMAT | common | Can be set to json output which is the container default. |
| COUPER_LOG_LEVEL | info | Set the log-level to one of: info, panic, fatal, error, warn, debug, trace. |
| COUPER_LOG_PARENT_FIELD | "" | An option for json log format to add all log fields as child properties. |
| COUPER_LOG_PRETTY | false | Global option for json log format which pretty prints with basic key coloring. |
| COUPER_LOG_TYPE_VALUE | couper_daemon | Value for the runtime log field type. |
| COUPER_ACCESS_LOG_REQUEST_HEADERS | User-Agent, Accept, Referer | A comma separated list of request header names whose values should be logged. |
| COUPER_ACCESS_LOG_RESPONSE_HEADERS | Cache-Control, Content-Encoding, Content-Type, Location | A comma separated list of response header names whose values should be logged. |
| COUPER_ACCESS_LOG_TYPE_VALUE | couper_access | Value for the log field type. |
| COUPER_BACKEND_LOG_REQUEST_HEADERS | User-Agent, Accept, Referer | A comma separated list of request header names whose values should be logged. |
| COUPER_BACKEND_LOG_RESPONSE_HEADERS | Cache-Control, Content-Encoding, Content-Type, Location | A comma separated list of response header names whose values should be logged. |
| COUPER_BACKEND_LOG_TYPE_VALUE | couper_backend | Value for the log field type. |
| COUPER_REQUEST_ID_ACCEPT_FROM_HEADER | "" | Name of a client request HTTP header field that transports the request.id which Couper takes for logging and transport to the backend (if configured). |
| COUPER_REQUEST_ID_BACKEND_HEADER | Couper-Request-ID | Name of a HTTP header field which Couper uses to transport the request.id to the backend. |
| COUPER_REQUEST_ID_CLIENT_HEADER | Couper-Request-ID | Name of a HTTP header field which Couper uses to transport the request.id to the client. |
| COUPER_REQUEST_ID_FORMAT | common | If set to uuid4 a rfc4122 uuid is used for request.id and related log fields. |
| COUPER_SERVER_TIMING_HEADER | false | If enabled, Couper includes an additional Server-Timing HTTP response header field detailing connection and transport relevant metrics for each backend request. |
| COUPER_BETA_METRICS | false | Option to enable the prometheus metrics exporter. |
| COUPER_BETA_METRICS_PORT | 9090 | Prometheus exporter listen port. |
| COUPER_BETA_SERVICE_NAME | couper | The service name which applies to the service_name metric labels. |
| Variable | Default | Description |
|---|---|---|
| COUPER_CA_FILE | "" | Option for adding the given PEM encoded ca-certificate to the existing system certificate pool for all outgoing connections. |
| COUPER_HTTPS_DEV_PROXY | "" | List of TLS port mappings to define the TLS listen port and the target one. A self-signed certificate will be generated on the fly based on given hostname. |
| COUPER_SECURE_COOKIES | "" | If set to "strip", the Secure flag is removed from all Set-Cookie HTTP header fields. |
| Variable | Default | Description |
|---|---|---|
| COUPER_PPROF | false | Enables profiling. |
| COUPER_PPROF_PORT | 6060 | Port for profiling interface. |
| Variable | Default | Description |
|---|---|---|
| COUPER_TIMING_IDLE_TIMEOUT | 60s | The maximum amount of time to wait for the next request on client connections when keep-alives are enabled. |
| COUPER_TIMING_READ_HEADER_TIMEOUT | 10s | The amount of time allowed to read client request headers. |
| COUPER_TIMING_SHUTDOWN_DELAY | 0 | The amount of time the server is marked as unhealthy until calling server close finally. |
| COUPER_TIMING_SHUTDOWN_TIMEOUT | 0 | The maximum amount of time allowed to close the server with all running connections. |
| Variable | Default | Description |
|---|---|---|
| COUPER_ACCEPT_FORWARDED_URL | "" | Which X-Forwarded-* request headers should be accepted to change the request variables url, origin, protocol, host, port. Comma-separated list of values. Valid values: proto, host, port. |
| COUPER_NO_PROXY_FROM_ENV | false | Disables the connect hop to configured proxy via environment. |
| COUPER_XFH | false | Global configurations which uses the X-Forwarded-Host header instead of the request host. |
Content type
Image
Digest
sha256:88beb8665…
Size
16.7 MB
Last updated
3 days ago
docker pull coupergateway/couper