forked from domecloud/kong-workshop
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
59 lines (56 loc) · 2.01 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
version: "3.8"
services:
kong-database:
image: postgres:${POSTGRES_VERSION:-latest}
container_name: kong-database
environment:
- POSTGRES_USER=${POSTGRES_USER:-kong}
- POSTGRES_DB=${POSTGRES_DB:-kong}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-kong}
volumes:
- ./pg_data:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
kong:
depends_on:
- kong-database
image: kong:${KONG_VERSION:-latest}
container_name: kong
restart: always
environment:
- TZ=${TZ:-Asia/Bangkok}
- KONG_DATABASE=postgres
- KONG_PG_HOST=${KONG_PG_HOST:-kong-database}
- KONG_PG_DATABASE=${POSTGRES_DB:-kong}
- KONG_PG_USER=${POSTGRES_USER:-kong}
- KONG_PG_PASSWORD=${POSTGRES_PASSWORD:-kong}
- KONG_ADMIN_LISTEN=${KONG_ADMIN_LISTEN:-127.0.0.1:8001}
- KONG_PROXY_LISTEN=${KONG_PROXY_LISTEN:-0.0.0.0:8000, 0.0.0.0:8443 ssl http2}
- KONG_NGINX_HTTP_RESOLVER=${KONG_NGINX_HTTP_RESOLVER:-8.8.8.8}
- KONG_PROXY_ERROR_LOG=/dev/stderr
- KONG_ADMIN_ERROR_LOG=/dev/stderr
- KONG_TRUSTED_IPS=0.0.0.0/0,::/0
- KONG_PLUGINS=bundled,zipkin-header,tcp-log-extends,rate-limiting-extends
- KONG_REAL_IP_RECURSIVE=on
- KONG_REAL_IP_HEADER=Cf-Connecting-Ip
- KONG_TRACING_INSTRUMENTATIONS=all
- KONG_TRACING_SAMPLING_RATE=1.0
- KONG_LOG_LEVEL=debug
volumes:
- ./plugins/zipkin-header/kong/plugins/zipkin-header:/usr/local/share/lua/5.1/kong/plugins/zipkin-header
- ./plugins/tcp-log-extends/kong/plugins/tcp-log-extends:/usr/local/share/lua/5.1/kong/plugins/tcp-log-extends
- ./plugins/rate-limiting-extends/kong/plugins/rate-limiting-extends:/usr/local/share/lua/5.1/kong/plugins/rate-limiting-extends
ports:
- 80:8000
- 443:8443
- 8001:8001
- 8002:8002
healthcheck:
test: ["CMD", "kong", "health"]
interval: 5s
timeout: 2s
retries: 5