-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
138 lines (123 loc) · 4.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
version: "3.8"
volumes:
go_plugins:
go_src:
go_pkg:
go_build_cache:
rust_plugins:
rust_targets:
cargo_cache_git:
cargo_cache_registry:
python_plugins:
pip_cache:
services:
reflector:
build: reflector
kong:
# image: kong:${KONG_VERSION}
build: kong
depends_on:
reflector:
condition: service_started
go-plugins:
condition: service_completed_successfully
rust-plugins:
condition: service_completed_successfully
python-plugins:
condition: service_completed_successfully
# mongo:
# condition: service_started
# kong-db:
# condition: service_healthy
# kong-db-migrations:
# condition: service_completed_successfully
# networks:
# - kong
deploy:
resources:
limits:
cpus: '0.15'
# memory: 1G
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "2"
environment:
KONG_LOG_LEVEL: info
KONG_PROXY_ACCESS_LOG: "off" #/dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_PROXY_LISTEN: 0.0.0.0:8080 reuseport backlog=163840
KONG_PORT_MAPS: "80:8080"
KONG_DATABASE: "off"
KONG_DECLARATIVE_CONFIG: /kong.yml
KONG_PLUGINSERVER_NAMES: goplugin,rustplugin,pythonplugin,jsplugin
KONG_PLUGINSERVER_GOPLUGIN_START_CMD: /go-plugins/goplugin -kong-prefix /usr/local/kong/
KONG_PLUGINSERVER_GOPLUGIN_QUERY_CMD: /go-plugins/goplugin -dump
KONG_PLUGINSERVER_GOPLUGIN_SOCKET: /usr/local/kong/goplugin.socket
KONG_PLUGINSERVER_RUSTPLUGIN_START_CMD: /rust-plugins/rustplugin -kong-prefix /usr/local/kong/
KONG_PLUGINSERVER_RUSTPLUGIN_QUERY_CMD: /rust-plugins/rustplugin -dump
KONG_PLUGINSERVER_RUSTPLUGIN_SOCKET: /usr/local/kong/rustplugin.socket
KONG_PLUGINSERVER_PYTHONPLUGIN_START_CMD: >
/python-plugins/pythonplugin
--kong-prefix /usr/local/kong/
--socket-name /usr/local/kong/pythonplugin.socket
--no-lua-style
--gevent
KONG_PLUGINSERVER_PYTHONPLUGIN_QUERY_CMD: /python-plugins/pythonplugin --dump
KONG_PLUGINSERVER_PYTHONPLUGIN_SOCKET: /usr/local/kong/pythonplugin.socket
KONG_PLUGINSERVER_JSPLUGIN_START_CMD: >
/usr/local/bin/kong-js-pluginserver
--sock-name jsplugin.socket
--plugins-directory /js-plugins
KONG_PLUGINSERVER_JSPLUGIN_QUERY_CMD: >
/usr/local/bin/kong-js-pluginserver
--plugins-directory /js-plugins
--dump-all-plugins
KONG_PLUGINSERVER_JSPLUGIN_SOCKET: /usr/local/kong/jsplugin.socket
# remember lua package path expects, a directory structure
# ../kong/plugins/<plugin>/*.lua to find the plugin
KONG_LUA_PACKAGE_PATH: /lua-plugins/?.lua;;
KONG_PLUGINS: bundled, goplugin, rustplugin, pythonplugin, jsplugin, luaplugin
volumes:
# - ../kong_upstream/kong:/usr/local/share/lua/5.1/kong
- ./kong.yml:/kong.yml
- go_plugins:/go-plugins
- rust_plugins:/rust-plugins
- python_plugins:/python-plugins
- ./js-plugins:/js-plugins
- ./lua-plugins:/lua-plugins/kong/plugins
ports:
- 80:8080
# - 443:8443
healthcheck:
test: kong health
interval: 10s
timeout: 2s
retries: 3
go-plugins:
build: go-plugins
volumes:
- ./go-plugins/entrypoint.sh:/entrypoint.sh
- ./go-plugins:/src
- go_plugins:/go-plugins
# cache
- go_src:/go/src
- go_pkg:/go/pkg
- go_build_cache:/root/.cache/go-build
rust-plugins:
build: rust-plugins
volumes:
- ./rust-plugins/entrypoint.sh:/entrypoint.sh
- ./rust-plugins:/src
- rust_plugins:/rust-plugins
- rust_targets:/rust-targets
- cargo_cache_git:/usr/local/cargo/git
- cargo_cache_registry:/usr/local/cargo/registry
python-plugins:
build: python-plugins
volumes:
- ./python-plugins/entrypoint.sh:/entrypoint.sh
- ./python-plugins:/src
- python_plugins:/python-plugins
- pip_cache:/root/.pip