Last active
September 30, 2021 01:44
-
-
Save fleeto/70f895be3a27a9906f79fc232877803d to your computer and use it in GitHub Desktop.
Kong+KongA
This file contains hidden or 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
# Copied from https://gist.github.com/pantsel/73d949774bd8e917bfd3d9745d71febf | |
version: "3" | |
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 | |
POSTGRES_PASSWORD: "kong" | |
ports: | |
- "5432:5432" | |
####################################### | |
# Kong database migration | |
####################################### | |
kong-migration: | |
image: kong:latest | |
command: "kong migrations bootstrap" | |
networks: | |
- kong-net | |
restart: on-failure | |
environment: | |
KONG_PG_HOST: kong-database | |
KONG_DATABASE: postgres | |
KONG_PG_USER: kong | |
KONG_PG_PASSWORD: kong | |
links: | |
- kong-database | |
depends_on: | |
- kong-database | |
####################################### | |
# Kong: The API Gateway | |
####################################### | |
kong: | |
image: kong:latest | |
restart: always | |
networks: | |
- kong-net | |
environment: | |
KONG_DATABASE: postgres | |
KONG_PG_HOST: kong-database | |
KONG_PG_USER: kong | |
KONG_PG_PASSWORD: kong | |
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 | |
depends_on: | |
- kong-migration | |
- kong-database | |
healthcheck: | |
test: ["CMD", "curl", "-f", "http://kong:8001"] | |
interval: 5s | |
timeout: 2s | |
retries: 15 | |
ports: | |
- "8001:8001" | |
- "8000:8000" | |
####################################### | |
# Konga database prepare | |
####################################### | |
konga-prepare: | |
image: pantsel/konga:next | |
command: "-c prepare -a postgres -u postgresql://kong:kong@kong-database:5432/konga" | |
networks: | |
- kong-net | |
restart: on-failure | |
links: | |
- kong-database | |
depends_on: | |
- kong-database | |
####################################### | |
# Konga: Kong GUI | |
####################################### | |
konga: | |
image: pantsel/konga:next | |
restart: always | |
networks: | |
- kong-net | |
environment: | |
DB_ADAPTER: postgres | |
DB_HOST: kong-database | |
DB_USER: kong | |
DB_PASSWORD: kong | |
TOKEN_SECRET: km1GUr4RkcQD7DewhJPNXrCuZwcKmqjb | |
DB_DATABASE: konga | |
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