-
Notifications
You must be signed in to change notification settings - Fork 33
/
docker-compose.yml
104 lines (97 loc) · 2.43 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
version: '2.1'
services:
kong-database:
image: postgres:9.6.11-alpine
container_name: kong-database
volumes:
- kong_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: kong
POSTGRES_DB: kong
healthcheck:
test: pg_isready -U kong && psql -d kong -U kong -c "SELECT 1=1"
interval: 10s
timeout: 5s
retries: 5
kong-migration:
build: ./kong
container_name: kong-migration
depends_on:
kong-database:
condition: service_healthy
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
command: sh -c "(kong migrations up || kong migrations bootstrap) && touch migrations_run && sleep 30"
healthcheck:
test: "if [[ -f migrations_run ]] ; then exit 0; else exit 1; fi"
interval: 10s
timeout: 5s
retries: 5
kong:
build: ./kong
container_name: kong
depends_on:
kong-database:
condition: service_healthy
kong-migration:
condition: service_healthy
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
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
ports:
- 8000:8000
- 8001:8001
- 8443:8443
healthcheck:
test: kong health
interval: 10s
timeout: 5s
retries: 5
konga-database:
image: mongo:4.1.5
container_name: konga-database
volumes:
- konga_data:/data/db
ports:
- 27017:27017
healthcheck:
test: echo 'db.stats().ok' | mongo localhost:27017/konga --quiet
interval: 10s
timeout: 5s
retries: 5
# kong-dashboard:
# image: pgbi/kong-dashboard:v3
# container_name: kong-dashboard
# depends_on:
# kong:
# condition: service_healthy
# command: start --kong-url http://kong:8001
# ports:
# - 8080:8080
# restart: on-failure
konga:
build: ./konga
container_name: konga
depends_on:
konga-database:
condition: service_healthy
volumes:
- ./konga/user_seed.js:/app/user_seed.js:ro
ports:
- 1337:1337
environment:
DB_ADAPTER: mongo
DB_DATABASE: konga
DB_HOST: konga-database
KONGA_SEED_USER_DATA_SOURCE_FILE: /app/user_seed.js
NODE_ENV: production
restart: on-failure
volumes:
kong_data:
konga_data: