Skip to content

Instantly share code, notes, and snippets.

@sjpuas
Created June 5, 2018 13:36
Show Gist options
  • Save sjpuas/166222d825e62c4e802e698eb8740b50 to your computer and use it in GitHub Desktop.
Save sjpuas/166222d825e62c4e802e698eb8740b50 to your computer and use it in GitHub Desktop.
Kong CE Docker Compose
version: '2.1'
services:
kong-database:
image: postgres:9.5
environment:
- POSTGRES_USER=kong
- POSTGRES_DB=kong
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 10s
timeout: 5s
retries: 5
kong-migration:
image: kong:latest
command: kong migrations up
depends_on:
kong-database:
condition: service_healthy
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
kong:
image: kong:latest
restart: always
depends_on:
- kong-migration
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_PG_DATABASE=kong
- KONG_ADMIN_LISTEN=0.0.0.0:8001
ports:
- 443:8443
- 8001:8001
- 7945:7945
- 7373:7373
healthcheck:
test: ["CMD-SHELL", "curl -I -s -L http://127.0.0.1:8000 || exit 1"]
interval: 5s
retries: 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment