Skip to content

Instantly share code, notes, and snippets.

@eturan
Created May 13, 2019 15:20
Show Gist options
  • Save eturan/9012909c8bcc784628e4d5b716761b5e to your computer and use it in GitHub Desktop.
Save eturan/9012909c8bcc784628e4d5b716761b5e to your computer and use it in GitHub Desktop.
docker-compose for local KONG setup with dashboard
version: '3.7'
networks:
kong_network:
name: kong_network
services:
kong-database:
image: postgres:11-alpine
networks:
- kong_network
container_name: kong-database
environment:
- POSTGRES_USER=kong
- POSTGRES_DB=kong
healthcheck:
test: "pg_isready -U kong && psql -d kong -U kong -c \"SELECT 1=1\""
interval: 10s
timeout: 5s
retries: 5
kong:
image: kong:v1.0.3
networks:
kong_network:
container_name: kong
healthcheck:
test: "kong health"
interval: 10s
timeout: 5scd
retries: 5
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_ADMIN_LISTEN=0.0.0.0:8001
- KONG_PLUGINS=bundled,oidc
ports:
- 8001:8001
- 8000:8000
command: >
sh -c "echo waiting postgres to up and running &&
sh -c 'until nc -z kong-database 5432; do sleep 1; done' &&
kong migrations bootstrap &&
kong start"
kong-dashboard:
image: pgbi/kong-dashboard:v3.6.0
networks:
- kong_network
container_name: kong-dashboard
ports:
- 8080:8080
depends_on:
- kong
entrypoint: >
/bin/sh -c "echo waiting kong admin to up and running &&
/bin/sh -c 'until nc -z kong 8001; do sleep 1; done' &&
/bin/sh -c './bin/kong-dashboard.js start --kong-url http://kong:8001 --basic-auth admin=admin1234'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment