Kong with ability to reference environment variables in declarative configuration file.
Kong declarative configuration doesn't support environment variables interpolation ie. refencing an environment variable to be substituted at runtime.
This image is based on the official Kong image and uses the same Dockerfile used to build the official one, but with a custom entrypoint that does the interpolation.
All strings that start with _FILE will be replaced by the value of the environment variable with the same name.
Create a config file with environment variables to be interpolated. For example:
with env
SECRET=SuperSecretValue
and file kong.yml
secret: SECRET_FILEwill be interpolated to
secret: SuperSecretValueexample.yaml
---
_format_version: '1.1'
consumers:
- username: anon
keyauth_credentials:
- key: ANON_KEY_FILERemember to set the environment variable to be interpolated: ANON_KEY
docker-compose.yml
services:
kong:
container_name: webhood-kong
image: ghcr.io/webhood-io/kong:main
restart: unless-stopped
environment:
ANON_KEY: ${ANON_KEY}
WEBHOOD_CONFIG: /tmp/kong.yml
volumes:
- ./kong.yml.example:/tmp/kong.yml:rodocker up -d- Support same base images than the official image. Now image is based on Debian (alpine, centos)
- Support other vars than what are supported by Webhood