-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
149 lines (139 loc) · 4.07 KB
/
docker-compose.yaml
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
version: "3.9"
services:
postgres:
image: postgres:11
container_name: kong-database
ports:
- 5432:5432
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD", "pg_isready", "-U", $POSTGRES_USER]
interval: 5s
timeout: 5s
retries: 5
restart: always
volumes:
- 'db:/var/lib/postgresql/data'
networks:
- kong-net
kong-gateway-migrations:
image: "kong:3.3.1-alpine"
container_name: kong-gateway-migrations
environment:
- KONG_DATABASE=${KONG_DATABASE}
- KONG_PG_HOST=${KONG_PG_HOST}
- KONG_PG_PASSWORD=${KONG_PG_PASSWORD}
- KONG_PASSWORD=${KONG_PASSWORD}
command: kong migrations bootstrap
restart: on-failure
depends_on:
postgres:
condition: service_healthy
networks:
- kong-net
kong-gateway:
image: "kong:3.3.1-alpine"
container_name: kong-gateway
ports:
- 8000:8000
- 8443:8443
- 8001:8001
- 8444:8444
- 8445:8445
- 8003:8003
- 8004:8004
environment:
- KONG_DATABASE=${KONG_DATABASE}
- KONG_PG_HOST=${KONG_PG_HOST}
- KONG_PG_USER=${KONG_PG_USER}
- KONG_PG_PASSWORD=${KONG_PG_PASSWORD}
- KONG_PROXY_ACCESS_LOG=${KONG_PROXY_ACCESS_LOG}
- KONG_ADMIN_ACCESS_LOG=${KONG_ADMIN_ACCESS_LOG}
- KONG_PROXY_ERROR_LOG=${KONG_PROXY_ERROR_LOG}
- KONG_ADMIN_ERROR_LOG=${KONG_ADMIN_ERROR_LOG}
- KONG_ADMIN_LISTEN=${KONG_ADMIN_LISTEN}
- KONG_LICENSE_DATA
depends_on:
postgres:
condition: service_healthy
kong-gateway-migrations:
condition: service_completed_successfully
restart: always
networks:
- kong-net
konga-prepare:
image: pantsel/konga
container_name: konga-prepare
command: -c prepare -a postgres -u postgresql://${KONGA_DB_USER}:${KONGA_DB_PASSWORD}@kong-database:5432/${KONGA_DB_DATABASE}
healthcheck:
test: ["CMD", "pg_isready", "-U", $KONG_PG_HOST]
interval: 5s
timeout: 5s
retries: 5
depends_on:
kong-gateway:
condition: service_healthy
networks:
- kong-net
konga:
image: pantsel/konga
container_name: konga
ports:
- 1337:1337
environment:
- DB_ADAPTER=postgres
- DB_HOST=${KONGA_DB_HOST}
- DB_USER=${KONGA_DB_USER}
- DB_PASSWORD=${KONGA_DB_PASSWORD}
- DB_DATABASE=${KONGA_DB_DATABASE}
- KONGA_HOOK_TIMEOUT=120000
- NODE_ENV=${KONGA_DB_NODE_ENV}
depends_on:
kong-gateway:
condition: service_healthy
konga-prepare:
condition: service_completed_successfully
restart: always
networks:
- kong-net
servicea:
build: .
container_name: servicea
ports:
- 3001:3001
environment:
PORT: 3001
SERVICE_NAME: "Service A"
networks:
- kong-net
serviceb1:
build:
context: .
container_name: serviceb1
ports:
- 3021:3021
environment:
PORT: 3021
SERVICE_NAME: "Service B1"
networks:
- kong-net
serviceb2:
build:
context: .
container_name: serviceb2
ports:
- 3022:3022
environment:
PORT: 3022
SERVICE_NAME: "Service B2"
networks:
- kong-net
volumes:
db:
networks:
kong-net:
name: kong-net
external: true