Sign inSign up

coupergateway/couper

By coupergateway

Updated about 15 hours ago

Couper is a lightweight API gateway designed for building and operating API-driven Web projects.

Image
1

50K+

coupergateway/couper repository overview

Couper

Couper

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.

Usage

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

Command

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

Environment Variables

Basic Environment Variables
VariableDefaultDescription
COUPER_BIND_ADDRESS"*"A comma-separated list of addresses to bind.
COUPER_FILEcouper.hclPath to the configuration file.
COUPER_FILE_DIRECTORY""Path to the configuration files directory.
COUPER_DEFAULT_PORT8080Sets 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_WATCHfalseSet to true to watch for configuration file changes.
COUPER_WATCH_RETRIES5Maximal retry count for configuration reloads which could not bind the configured port.
COUPER_WATCH_RETRY_DELAY500msDelay duration before next attempt if an error occurs.
Observation Environment Variables
VariableDefaultDescription
COUPER_HEALTH_PATH/healthzPath for health-check requests for all servers and ports.
COUPER_LOG_FORMATcommonCan be set to json output which is the container default.
COUPER_LOG_LEVELinfoSet 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_PRETTYfalseGlobal option for json log format which pretty prints with basic key coloring.
COUPER_LOG_TYPE_VALUEcouper_daemonValue for the runtime log field type.
COUPER_ACCESS_LOG_REQUEST_HEADERSUser-Agent, Accept, RefererA comma separated list of request header names whose values should be logged.
COUPER_ACCESS_LOG_RESPONSE_HEADERSCache-Control, Content-Encoding, Content-Type, LocationA comma separated list of response header names whose values should be logged.
COUPER_ACCESS_LOG_TYPE_VALUEcouper_accessValue for the log field type.
COUPER_BACKEND_LOG_REQUEST_HEADERSUser-Agent, Accept, RefererA comma separated list of request header names whose values should be logged.
COUPER_BACKEND_LOG_RESPONSE_HEADERSCache-Control, Content-Encoding, Content-Type, LocationA comma separated list of response header names whose values should be logged.
COUPER_BACKEND_LOG_TYPE_VALUEcouper_backendValue 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_HEADERCouper-Request-IDName of a HTTP header field which Couper uses to transport the request.id to the backend.
COUPER_REQUEST_ID_CLIENT_HEADERCouper-Request-IDName of a HTTP header field which Couper uses to transport the request.id to the client.
COUPER_REQUEST_ID_FORMATcommonIf set to uuid4 a rfc4122 uuid is used for request.id and related log fields.
COUPER_SERVER_TIMING_HEADERfalseIf enabled, Couper includes an additional Server-Timing HTTP response header field detailing connection and transport relevant metrics for each backend request.
COUPER_BETA_METRICSfalseOption to enable the prometheus metrics exporter.
COUPER_BETA_METRICS_PORT9090Prometheus exporter listen port.
COUPER_BETA_SERVICE_NAMEcouperThe service name which applies to the service_name metric labels.
TLS Environment Variables
VariableDefaultDescription
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.
Profiling Environment Variables
VariableDefaultDescription
COUPER_PPROFfalseEnables profiling.
COUPER_PPROF_PORT6060Port for profiling interface.
Timing Environment Variables
VariableDefaultDescription
COUPER_TIMING_IDLE_TIMEOUT60sThe maximum amount of time to wait for the next request on client connections when keep-alives are enabled.
COUPER_TIMING_READ_HEADER_TIMEOUT10sThe amount of time allowed to read client request headers.
COUPER_TIMING_SHUTDOWN_DELAY0The amount of time the server is marked as unhealthy until calling server close finally.
COUPER_TIMING_SHUTDOWN_TIMEOUT0 The maximum amount of time allowed to close the server with all running connections.
Surrounding Architecture Environment Variables
VariableDefaultDescription
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_ENVfalseDisables the connect hop to configured proxy via environment.
COUPER_XFHfalseGlobal configurations which uses the X-Forwarded-Host header instead of the request host.

Tag summary

Content type

Image

Digest

sha256:88beb8665

Size

16.7 MB

Last updated

2 days ago

docker pull coupergateway/couper