Skip to content

Instantly share code, notes, and snippets.

@hunzo
Last active May 6, 2025 08:27
Show Gist options
  • Save hunzo/134e2f224aa54f8aab8058b76da7a91f to your computer and use it in GitHub Desktop.
Save hunzo/134e2f224aa54f8aab8058b76da7a91f to your computer and use it in GitHub Desktop.
simple kong-gateway
POSTGRES_USER=kong
POSTGRES_DB=kong
POSTGRES_PASSWORD=postgres_password
KONG_PASSWORD=kong_password
KONG_LICENSE_DATA=
TZ=Asia/Bangkok
networks:
kong-net:
services:
kong-database:
image: postgres:13
container_name: kong-database
restart: unless-stopped
networks:
- kong-net
ports:
- 5432:5432
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
kong-migrations:
image: kong/kong-gateway:3.10.0.1
depends_on:
- kong-database
networks:
- kong-net
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
KONG_PG_PASSWORD: ${POSTGRES_PASSWORD}
KONG_PASSWORD: ${KONG_PASSWORD}
command: kong migrations bootstrap
restart: on-failure
kong-gateway:
image: kong/kong-gateway:3.10.0.1
container_name: kong-gateway
depends_on:
- kong-migrations
restart: unless-stopped
networks:
- kong-net
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
KONG_PG_USER: ${POSTGRES_USER}
KONG_PG_PASSWORD: ${POSTGRES_PASSWORD}
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_ADMIN_ERROR_LOG: /dev/stderr
KONG_ADMIN_LISTEN: 0.0.0.0:8001
KONG_ADMIN_GUI_URL: http://localhost:8002
KONG_LICENSE_DATA: ${KONG_LICENSE_DATA}
ports:
- "80:8000"
- "443:8443"
- "127.0.0.1:8001:8001"
- "127.0.0.1:8444:8444"
konga:
image: pantsel/konga:latest
container_name: konga
restart: unless-stopped
networks:
- kong-net
environment:
NODE_ENV: production
SKIP_PRODUCTION_WARNINGS: true
NODE_OPTIONS: --no-deprecation
TZ: ${TZ}
ports:
- 1337:1337

Check Docker Network

docker network ls

restore decK docker

docker run \
  --rm \
  -v .:/files \
  -w /files \
  -e DECK_KONG_ADDR=http://kong-gateway:8001 \
  --network kong_kong-net \
  kong/deck gateway sync backup-kong-20250506.yaml

backup decK docker

docker run \
  --rm \
  -v .:/files \
  -w /files \
  -e DECK_KONG_ADDR=http://kong-gateway:8001 \
  --network kong_kong-net \
  kong/deck gateway dump -o backup-kong.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment