This repository has been archived by the owner on Jul 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
148 lines (141 loc) · 3.32 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
139
140
141
142
143
144
145
146
147
148
version: "3.7"
services:
# Database
kong-database:
image: postgres:9.6-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
deploy:
restart_policy:
condition: on-failure
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER_PASSWD=${POSTGRES_USER_PASSWD}
logging:
driver: gelf
options:
gelf-address: "udp://${GRAYLOG_ADDR}:${GRAYLOG_PORT}"
ports:
- 5432:5432
networks:
- kong-net
# Kong
kong:
image: kong:1.2.1-alpine
depends_on:
- kong-database
restart: unless-stopped
deploy:
replicas: ${KONG_REPLICAS}
restart_policy:
condition: on-failure
environment:
- KONG-DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_PG_DATABASE=${POSTGRES_DB}
- KONG_PG_USER=${POSTGRES_USER}
- KONG_PG_PASSWORD=${POSTGRES_USER_PASSWD}
- 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
- KONG_ADMIN_LISTEN_SSL=0.0.0.0:8444
logging:
driver: gelf
options:
gelf-address: "udp://${GRAYLOG_ADDR}:${GRAYLOG_PORT}"
ports:
- 8000:8000
- 8443:8443
- 8001:8001
- 8444:8444
networks:
- kong-net
#Kong migrations
kong-migration:
image: kong:1.2.1-alpine
depends_on:
- kong-database
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_PG_DATABASE=${POSTGRES_DB}
- KONG_PG_USER=${POSTGRES_USER}
command: ash -c "sleep 30 && kong migrations bootstrap"
logging:
driver: gelf
options:
gelf-address: "udp://${GRAYLOG_ADDR}:${GRAYLOG_PORT}"
networks:
- kong-net
#Konga dashboard
konga-dashboard:
image: pantsel/konga
depends_on:
- kong
- konga-mongodb
restart: unless-stopped
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
restart_policy:
condition: on-failure
environment:
- NODE_ENV=${ENVIRONMENT}
- TOKEN_SECRET=${KONGA_TOKEN_SECRET}
- DB_ADAPTER=mongo
- DB_HOST=konga-mongodb
- DB_PORT=27017
- DB_USER=kong
# - DB_PASSWORD=kong
# - DB_DATABASE=kong
logging:
driver: gelf
options:
gelf-address: "udp://${GRAYLOG_ADDR}:${GRAYLOG_PORT}"
ports:
- 1337:1337
networks:
- kong-net
konga-mongodb:
image: mongo:latest
volumes:
- mongo_data:/data/db
restart: unless-stopped
deploy:
placement:
constraints:
- node.role == manager
restart_policy:
condition: on-failure
networks:
- kong-net
#Monitoring
cadvisor:
image: google/cadvisor
hostname: '{{.Node.Hostname}}'
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
deploy:
mode: global
restart_policy:
condition: on-failure
logging:
driver: gelf
options:
gelf-address: "udp://${GRAYLOG_ADDR}:${GRAYLOG_PORT}"
ports:
- 8080:8080
networks:
kong-net:
volumes:
postgres_data:
mongo_data: