Kong API Gateway deployment with docker and docker-compose
This deployment is production ready.
Copy default.env
to .env
cp default.env .env
then edit the .env
file to change default values.
Variable name | Default value |
---|---|
POSTGRES_VERSION |
13-alpine |
POSTGRES_USER |
kong |
POSTGRES_PASSWORD |
kong |
POSTGRES_DB |
kong |
KONG_VERSION |
2.2 |
KONG_ADMIN_LISTEN |
0.0.0.0:8001 |
KONG_PROXY_LISTEN |
0.0.0.0:8000, 0.0.0.0:8443 ssl http2 |
KONG_NGINX_HTTP_RESOLVER |
8.8.8.8 |
KONG_PG_HOST |
kong-database |
KONG_PG_USER |
kong == env POSTGRES_USER |
KONG_PG_PASSWORD |
kong == env POSTGRES_PASSWORD |
KONG_PG_DATABASE |
kong == env POSTGRES_DB |
time ./quick-start.sh
docker-compose up -d kong-database
docker-compose run --rm kong kong migrations bootstrap --vv
docker-compose up -d kong
Now Kong is running
- Kong Admin API http://127.0.0.1:8001
- Kong Proxy http://127.0.0.1
docker-compose up -d konga
Now Konga is running
- Konga http://127.0.0.1:1337
If you deploy Kong on a remote host we can access Konga via ssh tunnel
ssh -L 1337:127.0.0.1:1337 [email protected]
Now you can access konga on localhost
WARNING : This may take some downtime to start a new Kong version.
-
Change
KONG_VERSION
in.env
file to a newer version.If running kong version 2.2 change to 2.3 (or 2.3.0). Suggested upgrade path
-
Run migrations upgrade
docker-compose run --rm kong kong migrations up --vv
-
Confirm finish migrations upgrade
docker-compose run --rm kong kong migrations finish --vv
-
Start new Kong version
docker-compose up -d kong