-
Notifications
You must be signed in to change notification settings - Fork 0
/
kong
165 lines (153 loc) · 3.77 KB
/
kong
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
##
## Kong docker-compose for fast installation
##
version: "3.8"
networks:
kong-net:
name: kong-net
driver: bridge
ipam:
config:
- subnet: 172.1.1.0/24
services:
#######################################
# Postgres: The database used by Kong
#######################################
kong-database:
container_name: kong-database
image: postgres:11-alpine
restart: unless-stopped
networks:
- kong-net
environment:
POSTGRES_USER: kong
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "kong"]
interval: 30s
timeout: 3s
retries: 5
#######################################
# Kong database migration
#######################################
kong-migration:
container_name: kong-migration
image: kong:2.1.4-alpine
command: "kong migrations bootstrap"
networks:
- kong-net
restart: on-failure
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
KONG_PG_USER: kong
KONG_PG_PASSWORD: password
links:
- kong-database
depends_on:
- kong-database
#######################################
# Kong: The API Gateway
#######################################
kong:
container_name: kong
image: kong:2.1.4-alpine
restart: unless-stopped
networks:
kong-net:
ipv4_address: 172.1.1.40
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
KONG_PG_USER: kong
KONG_PG_PASSWORD: password
KONG_ADMIN_LISTEN: "0.0.0.0:8001, 0.0.0.0:8444 ssl"
KONG_DB_UPDATE_FREQUENCY: 1m
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_ADMIN_ERROR_LOG: /dev/stderr
depends_on:
- kong-migration
ports:
- "8001:8001"
- "8444:8444"
- "8000:8000"
- "8443:8443"
#######################################
# Konga database prepare
#######################################
konga-prepare:
container_name: konga-prepare
image: pantsel/konga:0.14.9
command: "-c prepare -a postgres -u postgresql://kong:password@kong-database:5432/konga_db"
networks:
- kong-net
restart: on-failure
links:
- kong-database
depends_on:
- kong-database
#######################################
# Konga: Kong GUI
#######################################
konga:
container_name: konga
image: pantsel/konga:0.14.9
restart: unless-stopped
networks:
- kong-net
environment:
DB_ADAPTER: postgres
DB_HOST: kong-database
DB_USER: kong
DB_PASSWORD: password
DB_DATABASE: konga_db
# any string will OK for token
TOKEN_SECRET: iu7YDcPLiZkozQXzZ9kka3Ee1Vid5ZgQ
NODE_ENV: development
depends_on:
- konga-prepare
ports:
- "1337:1337"
#######################################
# Demo services : alpha, beta, gamma, omega
#######################################
alpha:
container_name: alpha
image: timpamungkas/alpha:2.0
restart: unless-stopped
networks:
kong-net:
ipv4_address: 172.1.1.11
ports:
- "9001:9001"
beta:
container_name: beta
image: timpamungkas/beta:2.0
restart: unless-stopped
networks:
kong-net:
ipv4_address: 172.1.1.12
ports:
- "9002:9002"
gamma:
container_name: gamma
image: timpamungkas/gamma:2.0
restart: unless-stopped
networks:
kong-net:
ipv4_address: 172.1.1.13
ports:
- "9003:9003"
omega:
container_name: omega
image: timpamungkas/omega:2.0
restart: unless-stopped
networks:
kong-net:
ipv4_address: 172.1.1.14
ports:
- "9004:9004"