docker-compose-kong.ymal配置文件
version: '3'
services:
kong-database:
image: postgres:9.6
container_name: kong-database
ports:
- 5432:5432
environment:
- POSTGRES_USER=kong
- POSTGRES_DB=kong
- POSTGRES_PASSWORK=kong
volumes:
- "/data/kong-db-postgres:/var/lib/postgresql/data"
kong-migrations:
image: kong:latest
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_PG_USER=kong
- KONG_PG_PASSWORD=kong
command: kong kong-migrations bootstrap
restart: on-failure
depends_on:
- kong-database
kong:
image: kong:latest
container_name: kong
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_PG_USER=kong
- KONG_PG_PASSWORD=kong
- KONG_PROXY_ACCESS_LOG=/dev/stdout
- KONG_ADMIN_ACCESS_LOG=/dev/stdout
- KONG_PROXY_ERROR_LOG=/dev/stderr
- KONG_ADMIN_ERROR_LOG=/dev/stderr
- KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl
restart: on-failure
ports:
- 8000:8000
- 8443:8443
- 8001:8001
- 8444:8444
links:
- kong-database:kong-database
depends_on:
- kong-migrations
konga:
image: pantsel/konga:latest
port:
- 1337:1337
links:
- kong:kong
container_name: konga
environment:
- NODE-ENV=production