Skip to content

Instantly share code, notes, and snippets.

@hunzo
Created September 16, 2024 06:40
Show Gist options
  • Save hunzo/a493f3ba961dc2eb827508c08c5430a1 to your computer and use it in GitHub Desktop.
Save hunzo/a493f3ba961dc2eb827508c08c5430a1 to your computer and use it in GitHub Desktop.
kong startup
services:
kong-db:
image: postgres:9.6-alpine
container_name: kong-db
restart: always
environment:
- POSTGRES_DB=kong
- POSTGRES_USER=kong
- POSTGRES_PASSWORD=kong
healthcheck:
test: ["CMD-SHELL", "pg_isready -U kong"]
interval: 5s
timeout: 2s
retries: 15
networks:
- kong-network
kong-migration:
image: "kong/kong-gateway:${TAG-latest}"
command: kong migrations bootstrap
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-db
- KONG_PG_USER=kong
- KONG_PG_PASSWORD=kong
- KONG_PG_DATABASE=kong
- KONG_TRUSTED_IPS=0.0.0.0/0
- KONG_ADMIN_LISTEN=0.0.0.0:8001
- KONG_LUA_SSL_TRUSTED_CERTIFICATE=/etc/ssl/certs/ca-certificates.crt
- TZ=Asia/Bangkok
depends_on:
- kong-db
restart: on-failure
networks:
- kong-network
kong:
image: "kong/kong-gateway:${TAG-latest}"
container_name: kong
restart: always
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-db
- KONG_PG_USER=kong
- KONG_PG_PASSWORD=kong
- KONG_PG_DATABASE=kong
- KONG_TRUSTED_IPS=0.0.0.0/0
- KONG_ADMIN_LISTEN=0.0.0.0:8001
- KONG_LUA_SSL_TRUSTED_CERTIFICATE=/etc/ssl/certs/ca-certificates.crt
- TZ=Asia/Bangkok
ports:
- 127.0.0.1:8001:8001
- 127.0.0.1:8444:8444
- 80:8000
- 443:8443
healthcheck:
test: ["CMD", "kong", "health"]
interval: 5s
timeout: 2s
retries: 15
networks:
- kong-network
konga:
image: pantsel/konga
container_name: konga
restart: always
environment:
- NODE_ENV=production
ports:
- 1337:1337
networks:
- kong-network
networks:
kong-network:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment