-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdocker-compose.yml
300 lines (288 loc) · 6.12 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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
version: "2"
services:
caddy:
command: caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
restart: unless-stopped
networks:
- ipv6-service-net
- monitor-net
- host-monitor-net
env_file:
- './secrets/caddy.env'
build:
context: ./caddy
args:
- USE_SJTUG=true
volumes:
- "./data/caddy/data:/data"
- "./data/caddy/config:/config"
- "mirrorz-volume:/var/www/mirrorz:ro"
- "./caddy/Caddyfile.siyuan:/etc/caddy/Caddyfile.siyuan:ro"
- "./caddy/Caddyfile.zhiyuan:/etc/caddy/Caddyfile.zhiyuan:ro"
ports:
- 80:80
- 443:443
healthcheck:
test: curl -f http://localhost || exit 1
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
logging:
options:
max-size: "4M"
max-file: "20"
ulimits:
nofile:
soft: 80000
hard: 120000
frontend:
restart: unless-stopped
build:
context: ./frontend
networks:
- ipv6-service-net
expose:
- 3000
healthcheck:
test: curl -f http://localhost:3000 || exit 1
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
logging:
options:
max-size: "4M"
max-file: "20"
ulimits:
nofile:
soft: 80000
hard: 120000
lug:
restart: unless-stopped
command: -c /config.yaml
networks:
- ipv6-service-net
- proxy-net
- redis-net
- postgres-net
build:
context: ./lug
args:
- USE_SJTUG=true
- CLONE_VERSION=v0.1.18
- CLONE_V2_VERSION=v0.2.39
- RSYNC_SJTUG_VERSION=v0.4.16
- LUG_VERSION=v0.12.11
expose:
- 8081
- 7001
volumes:
- "./lug/worker-script:/worker-script:ro"
- "./data/lug:/data"
- "mirrorz-volume:/mirrorz"
- "./secrets/git-credentials:/root/.git-credentials:ro"
- "./secrets/lug-secrets.sh:/root/lug-secrets.sh:ro"
- "./secrets/ssh:/secrets_ssh:ro"
- "./secrets/mirror-intel.env:/secrets_s3:ro"
- "./secrets/gcp:/secrets_gcp:ro"
- "./secrets/pg.env:/secrets_pg:ro"
- "./common/gai.conf:/etc/gai.conf:ro"
- "./config.siyuan.yaml:/config.siyuan.yaml:ro"
- "./config.zhiyuan.yaml:/config.zhiyuan.yaml:ro"
tmpfs: /var/cache
environment:
RUST_LOG: info
env_file:
- './secrets/mirror-clone.env'
healthcheck:
test: curl -f http://localhost:7001/lug/v1/manager/summary || exit 1
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
logging:
options:
max-size: "4M"
max-file: "20"
ulimits:
nofile:
soft: 80000
hard: 120000
rsync-gateway:
build:
context: ./rsync-gateway
args:
- USE_SJTUG=true
- RSYNC_SJTUG_VERSION=v0.4.15
networks:
- ipv6-service-net
- postgres-net
- tunnel-net
expose:
- 8000
restart: unless-stopped
env_file:
- './secrets/mirror-intel.env'
- './secrets/pg.env'
environment:
RUST_LOG: info
RUST_BACKTRACE: 1
logging:
options:
max-size: "4M"
max-file: "20"
ulimits:
nofile:
soft: 80000
hard: 120000
postgres:
restart: unless-stopped
image: photonquantum/postgres-rsync-sjtug:latest
networks:
- postgres-net
expose:
- 5432
env_file:
- './secrets/pg.env'
logging:
options:
max-size: "4M"
max-file: "20"
ulimits:
nofile:
soft: 80000
hard: 120000
mem_limit: 30G
memswap_limit: 30G
logspout:
restart: unless-stopped
image: skyzh/logspout:v3.2.13
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
- tunnel-net
logging:
options:
max-size: "4M"
max-file: "20"
ulimits:
nofile:
soft: 80000
hard: 120000
mem_limit: 2G
memswap_limit: 2G
cadvisor:
restart: unless-stopped
networks:
- monitor-net
image: gcr.dockerproxy.com/cadvisor/cadvisor:v0.47.2
expose:
- 8080
volumes:
- "/:/rootfs:ro"
- "/var/run:/var/run:rw"
- "/sys:/sys:ro"
- "/var/lib/docker/:/var/lib/docker:ro"
logging:
options:
max-size: "4M"
max-file: "20"
ulimits:
nofile:
soft: 80000
hard: 120000
mem_limit: 2G
memswap_limit: 2G
clash:
build:
context: ./clash
command: -d /etc/clash
volumes:
- ./secrets/clash_config.yaml:/etc/clash/config.yaml:z,ro
networks:
- proxy-net
expose:
- 8080
- 1080
restart: unless-stopped
logging:
options:
max-size: "4M"
max-file: "20"
ulimits:
nofile:
soft: 80000
hard: 120000
mem_limit: 5G
memswap_limit: 5G
mirror-intel:
build:
context: ./mirror-intel
args:
- USE_SJTUG=true
- INTEL_VERSION=v0.1.34
networks:
- ipv6-service-net
expose:
- 8000
restart: unless-stopped
env_file:
- './secrets/mirror-intel.env'
environment:
RUST_LOG: info
logging:
options:
max-size: "4M"
max-file: "20"
ulimits:
nofile:
soft: 80000
hard: 120000
volumes:
- "./common/gai.conf:/etc/gai.conf:ro"
rsyncd:
build:
context: ./rsyncd
args:
- USE_SJTUG=true
logging:
options:
max-size: "2M"
max-file: "10"
ports:
- "873:873"
restart: unless-stopped
git-backend:
build:
context: ./git-backend
args:
- USE_SJTUG=true
logging:
options:
max-size: "2M"
max-file: "10"
restart: unless-stopped
networks:
- ipv6-service-net
networks:
host-monitor-net:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.31.0.0/16
monitor-net:
tunnel-net:
proxy-net:
ipv6-service-net:
enable_ipv6: true
driver: bridge
ipam:
driver: default
config:
- subnet: fd01::/80
redis-net:
postgres-net:
volumes:
mirrorz-volume: