-
Notifications
You must be signed in to change notification settings - Fork 41
/
docker-compose.yml
218 lines (204 loc) · 5.66 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
version: "3"
services:
mysql:
image: mysql/mysql-server
restart: unless-stopped
ports:
- 3306:3306
command:
- '--skip-log-bin'
environment:
MYSQL_ROOT_PASSWORD: root_pass
MYSQL_DATABASE: gorse
MYSQL_USER: gorse
MYSQL_PASSWORD: gorse_pass
volumes:
- mysql_data:/var/lib/mysql
mysqld-exporter:
image: prom/mysqld-exporter
restart: unless-stopped
environment:
DATA_SOURCE_NAME: gorse:gorse_pass@(mysql:3306)/
ports:
- 9104:9104
depends_on:
- mysql
worker:
image: zhenghaoz/gorse-worker:0.5
restart: unless-stopped
ports:
- 8089:8089
command: >
--master-host master --master-port 8086
--http-host 0.0.0.0 --http-port 8089
--log-path /var/log/gorse/worker.log
--log-max-age 30
--cache-path /var/lib/gorse/worker
volumes:
- log_data:/var/log/gorse
- worker_data:/var/lib/gorse
depends_on:
- master
server:
image: zhenghaoz/gorse-server:0.5
restart: unless-stopped
ports:
- 8087:8087
environment:
GORSE_CACHE_STORE: sqla+mysql://gorse:gorse_pass@mysql/gorse
GORSE_DATA_STORE: mysql://gorse:gorse_pass@tcp(mysql:3306)/gorse?parseTime=true
command: >
--master-host master --master-port 8086
--http-host 0.0.0.0 --http-port 8087
--log-path /var/log/gorse/server.log
--log-max-age 30
--cache-path /var/lib/gorse/server
volumes:
- log_data:/var/log/gorse
- server_data:/var/lib/gorse
depends_on:
- master
master:
image: zhenghaoz/gorse-master:0.5
restart: unless-stopped
ports:
- 8086:8086
- 8088:8088
environment:
GORSE_CACHE_STORE: mysql://gorse:gorse_pass@tcp(mysql:3306)/gorse?parseTime=true
GORSE_DATA_STORE: mysql://gorse:gorse_pass@tcp(mysql:3306)/gorse?parseTime=true
GORSE_DASHBOARD_USER_NAME: ${GORSE_DASHBOARD_USER_NAME}
GORSE_DASHBOARD_PASSWORD: ${GORSE_DASHBOARD_PASSWORD}
GORSE_SERVER_API_KEY: ${GORSE_API_KEY}
command: >
-c /etc/gorse/config.toml
--log-path /var/log/gorse/master.log
--log-max-age 30
--cache-path /var/lib/gorse
volumes:
- ./config/gorse.toml:/etc/gorse/config.toml
- log_data:/var/log/gorse
- master_data:/var/lib/gorse
depends_on:
- mysql
node-exporter:
image: prom/node-exporter:latest
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
expose:
- 9100
prometheus:
image: prom/prometheus
restart: unless-stopped
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
expose:
- 9090
grafana:
image: grafana/grafana:8.4.6
restart: unless-stopped
environment:
PROMETHEUS_HOST: prometheus
PROMETHEUS_PORT: 9090
LOKI_HOST: loki
LOKI_PORT: 3100
volumes:
- grafana_data:/var/lib/grafana
- ./provisioning:/etc/grafana/provisioning
ports:
- 3000:3000
loki:
image: grafana/loki:2.3.0
restart: unless-stopped
command: -config.file=/etc/loki/local-config.yaml
ports:
- 3100:3100
volumes:
- ./config/loki.yaml:/etc/loki/local-config.yaml
promtail:
image: grafana/promtail
restart: unless-stopped
command: -config.file=/etc/promtail/config.yml
ports:
- 9080:9080
volumes:
- log_data:/var/log/gorse
- ./config/promtail.yml:/etc/promtail/config.yml
jobs:
build:
context: .
dockerfile: docker/jobs/Dockerfile
restart: unless-stopped
environment:
GORSE_ADDRESS: http://server:8087
GORSE_API_KEY: ${GORSE_API_KEY}
BROKER_ADDRESS: sqla+mysql://gorse:gorse_pass@mysql/gorse
SQLALCHEMY_DATABASE_URI: mysql://gorse:gorse_pass@mysql:3306/gorse
LOKI_HOST: loki
LOKI_PORT: 3100
cronjobs:
build:
context: .
dockerfile: docker/cronjobs/Dockerfile
restart: unless-stopped
environment:
GORSE_ADDRESS: http://server:8087
GORSE_API_KEY: ${GORSE_API_KEY}
GITHUB_ACCESS_TOKEN: ${GITHUB_ACCESS_TOKEN}
SQLALCHEMY_DATABASE_URI: mysql://gorse:gorse_pass@mysql:3306/gorse
LOKI_HOST: loki
LOKI_PORT: 3100
web:
build:
context: .
dockerfile: docker/web/Dockerfile
restart: unless-stopped
ports:
- 5000:5000
environment:
GORSE_ADDRESS: http://server:8087
GORSE_API_KEY: ${GORSE_API_KEY}
BROKER_ADDRESS: sqla+mysql://gorse:gorse_pass@mysql/gorse
GITHUB_OAUTH_CLIENT_ID: ${GITHUB_OAUTH_CLIENT_ID}
GITHUB_OAUTH_CLIENT_SECRET: ${GITHUB_OAUTH_CLIENT_SECRET}
SECRET_KEY: ${SECRET_KEY}
SQLALCHEMY_DATABASE_URI: mysql://gorse:gorse_pass@mysql:3306/gorse
LOKI_HOST: loki
LOKI_PORT: 3100
backup:
build:
context: .
dockerfile: docker/backup/Dockerfile
restart: unless-stopped
environment:
MYSQL_HOST: mysql
MYSQL_DATABASE: gorse
MYSQL_USER: gorse
MYSQL_PASSWORD: gorse_pass
S3_BUCKET: gorse
S3_PREFIX: /gitrec
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
S3_BUCKET_LOCATION: ${S3_BUCKET_LOCATION}
S3_HOST_BASE: ${S3_HOST_BASE}
S3_HOST_BUCKET: ${S3_HOST_BUCKET}
volumes:
mysql_data:
worker_data:
server_data:
master_data:
log_data:
prometheus_data:
grafana_data: