Last active
January 21, 2020 09:05
-
-
Save anhdiepmmk/27ab15a25e0811423848e2d3afbc343c to your computer and use it in GitHub Desktop.
docker compose for kong
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
volumes: | |
kong_data: {} | |
networks: | |
kong-net: | |
driver: bridge | |
services: | |
####################################### | |
# Postgres: The database used by Kong | |
####################################### | |
kong-database: | |
image: postgres:9.6 | |
restart: always | |
networks: | |
- kong-net | |
environment: | |
POSTGRES_USER: kong | |
POSTGRES_DB: kong | |
ports: | |
- "5432:5432" | |
healthcheck: | |
test: ["CMD", "pg_isready", "-U", "kong"] | |
interval: 5s | |
timeout: 5s | |
retries: 5 | |
volumes: | |
- kong_data:/var/lib/postgresql/data | |
####################################### | |
# Kong database migration | |
####################################### | |
kong-migration: | |
image: kong:latest | |
command: "kong migrations bootstrap" | |
networks: | |
- kong-net | |
restart: on-failure | |
environment: | |
KONG_PG_HOST: kong-database | |
links: | |
- kong-database | |
depends_on: | |
- kong-database | |
####################################### | |
# Kong: The API Gateway | |
####################################### | |
kong: | |
image: kong:latest | |
networks: | |
- kong-net | |
environment: | |
KONG_PG_HOST: kong-database | |
KONG_DATABASE: postgres | |
KONG_PROXY_LISTEN: 0.0.0.0:8000 | |
KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443 | |
KONG_ADMIN_LISTEN: '0.0.0.0:8001, 0.0.0.0:8444 ssl' | |
depends_on: | |
- kong-migration | |
- kong-database | |
ports: | |
- "8000:8000/tcp" | |
- "8001:8001/tcp" | |
- "8443:8443/tcp" | |
- "8444:8444/tcp" | |
healthcheck: | |
test: ["CMD", "kong", "health"] | |
interval: 10s | |
timeout: 10s | |
retries: 10 | |
restart: on-failure | |
####################################### | |
# Konga database prepare | |
####################################### | |
konga-prepare: | |
image: pantsel/konga:next | |
command: "-c prepare -a postgres -u postgresql://kong@kong-database:5432/konga_db" | |
networks: | |
- kong-net | |
restart: on-failure | |
links: | |
- kong-database | |
depends_on: | |
- kong-database | |
####################################### | |
# https://github.com/PGBI/kong-dashboard | |
####################################### | |
konga-dashboard: | |
image: pgbi/kong-dashboard | |
command: "start --kong-url http://kong:8001" | |
networks: | |
- kong-net | |
restart: always | |
depends_on: | |
- kong | |
ports: | |
- "8080:8080" | |
####################################### | |
# Konga: Kong GUI | |
# https://github.com/pantsel/konga | |
####################################### | |
konga: | |
image: pantsel/konga:next | |
restart: always | |
networks: | |
- kong-net | |
environment: | |
DB_ADAPTER: postgres | |
DB_HOST: kong-database | |
DB_USER: kong | |
TOKEN_SECRET: km1GUr4RkcQD7DewhJPNXrCuZwcKmqjb | |
DB_DATABASE: konga_db | |
NODE_ENV: production | |
depends_on: | |
- kong-database | |
ports: | |
- "1337:1337" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment