-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.dev.yml
256 lines (241 loc) · 8.55 KB
/
docker-compose.dev.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
version: '3.4'
name: 'msys2-repo-dev'
x-logging:
&default-logging
driver: 'local'
services:
docker-socket-proxy:
image: tecnativa/docker-socket-proxy
logging: *default-logging
environment:
- CONTAINERS=1
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- docker-socket-proxy
restart: unless-stopped
traefik:
image: traefik:v3.2
depends_on:
- docker-socket-proxy
command:
- "--api.insecure=true"
- "--log.level=INFO"
- "--providers.docker=true"
- "--providers.docker.endpoint=tcp://docker-socket-proxy:2375"
- "--providers.docker.exposedbydefault=false"
- "--providers.file.directory=/configs/"
- "--entrypoints.rsync.address=:873"
- "--entryPoints.rsync.transport.respondingTimeouts.readTimeout=0"
- "--entryPoints.web.address=:80"
# Access logs: Which request+status from which IP using which User-Agent?
- "--accesslog=true"
- "--accesslog.bufferingsize=100"
- "--accesslog.format=json"
- "--accesslog.fields.defaultmode=drop"
- "--accesslog.fields.names.RequestHost=keep"
- "--accesslog.fields.names.RequestMethod=keep"
- "--accesslog.fields.names.RequestPath=keep"
- "--accesslog.fields.names.RequestPort=keep"
- "--accesslog.fields.names.RequestProtocol=keep"
- "--accesslog.fields.names.ClientHost=keep"
- "--accesslog.fields.names.DownstreamStatus=keep"
- "--accesslog.fields.headers.defaultmode=drop"
- "--accesslog.fields.headers.names.User-Agent=keep"
logging: *default-logging
ports:
- "9090:80"
- "8080:8080"
- "873:873"
volumes:
- ./services/traefik/traefik-tls.yml:/configs/traefik-tls.yml:ro
networks:
- default
- docker-socket-proxy
- rsync
- mirrorbits
- stagingrepo
- repo
- packages
- stats
restart: unless-stopped
stats:
build: ./services/stats
logging: *default-logging
networks:
- stats
labels:
- "traefik.enable=true"
- "traefik.http.services.stats.loadbalancer.server.port=80"
- "traefik.docker.network=msys2-repo-dev_stats"
- "traefik.http.middlewares.stats-strip.stripprefix.prefixes=/stats"
- "traefik.http.middlewares.stats-slash-redir.redirectregex.regex=^http(s?)://([^/]*)/stats($$|[?].*)"
- "traefik.http.middlewares.stats-slash-redir.redirectregex.replacement=http$${1}://$${2}/stats/$${3}"
# http
- "traefik.http.routers.stats.rule=Host(`repo.localhost`) && (Path(`/stats`) || PathPrefix(`/stats/`))"
- "traefik.http.routers.stats.middlewares=stats-slash-redir,stats-strip"
- "traefik.http.routers.stats.entrypoints=web"
restart: unless-stopped
packages:
image: ghcr.io/msys2/msys2-web:latest
logging: *default-logging
networks:
- packages
labels:
- "traefik.enable=true"
- "traefik.docker.network=msys2-repo-dev_packages"
- "traefik.http.middlewares.packages-compress.compress=true"
# http
- "traefik.http.routers.packages.rule=Host(`packages.localhost`)"
- "traefik.http.routers.packages.middlewares=packages-compress"
- "traefik.http.routers.packages.entrypoints=web"
environment:
- FORWARDED_ALLOW_IPS=*
restart: unless-stopped
repo:
image: nginx:1.26
logging: *default-logging
networks:
- repo
volumes:
- ./devrepo/:/usr/share/nginx/html/:ro
- ./services/repo/nginx.conf:/etc/nginx/conf.d/repo.conf:ro
labels:
- "traefik.enable=true"
- "traefik.http.services.repo.loadbalancer.server.port=80"
- "traefik.docker.network=msys2-repo-dev_repo"
- "traefik.http.middlewares.repo-legacy-mingw32-redir.redirectregex.regex=^http(s?)://([^/]*)/mingw/i686($$|/.*)"
- "traefik.http.middlewares.repo-legacy-mingw32-redir.redirectregex.replacement=http$${1}://$${2}/mingw/mingw32$${3}"
- "traefik.http.middlewares.repo-legacy-mingw64-redir.redirectregex.regex=^http(s?)://([^/]*)/mingw/x86_64($$|/.*)"
- "traefik.http.middlewares.repo-legacy-mingw64-redir.redirectregex.replacement=http$${1}://$${2}/mingw/mingw64$${3}"
# http
- "traefik.http.routers.repo.rule=Host(`repo.localhost`)"
- "traefik.http.routers.repo.entrypoints=web"
- "traefik.http.routers.repo.middlewares=repo-legacy-mingw32-redir,repo-legacy-mingw64-redir"
restart: unless-stopped
staging:
build: ./services/staging/
logging: *default-logging
networks:
- staging
volumes:
- staging-gnupg:/root/.gnupg/
- staging-repos:/srv/msys2staging/
env_file:
- ./github_token.env
restart: unless-stopped
stagingrepo:
image: nginx:1.26
logging: *default-logging
networks:
- stagingrepo
volumes:
- staging-repos:/usr/share/nginx/html/:ro
- ./services/stagingrepo/nginx.conf:/etc/nginx/conf.d/repo.conf:ro
labels:
- "traefik.enable=true"
- "traefik.docker.network=msys2-repo-dev_stagingrepo"
- "traefik.http.services.stagingrepo.loadbalancer.server.port=80"
- "traefik.http.middlewares.staging-strip.stripprefix.prefixes=/staging"
- "traefik.http.middlewares.staging-slash-redir.redirectregex.regex=^http(s?)://([^/]*)/staging($$|[?].*)"
- "traefik.http.middlewares.staging-slash-redir.redirectregex.replacement=http$${1}://$${2}/staging/$${3}"
# http
- "traefik.http.routers.staging.rule=Host(`repo.localhost`) && (Path(`/staging`) || PathPrefix(`/staging/`))"
- "traefik.http.routers.staging.middlewares=staging-slash-redir,staging-strip"
- "traefik.http.routers.staging.entrypoints=web"
restart: unless-stopped
rsync:
build: ./services/rsync/
logging: *default-logging
volumes:
- ./devrepo/:/rsync-volume/:ro
- ./services/rsync/rsyncd.conf:/etc/rsyncd.conf:ro
networks:
- rsync
labels:
- "traefik.enable=true"
- "traefik.docker.network=msys2-repo-dev_rsync"
- "traefik.tcp.routers.rsync.rule=HostSNI(`*`)"
- "traefik.tcp.routers.rsync.entrypoints=rsync"
- "traefik.tcp.services.rsync.loadbalancer.server.port=873"
- "traefik.tcp.services.rsync.loadbalancer.proxyprotocol.version=2"
restart: unless-stopped
valkey:
image: valkey/valkey:8.0
restart: unless-stopped
logging: *default-logging
networks:
- mirrorbits-valkey
entrypoint: valkey-server --save 3600 1 --loglevel warning
volumes:
- valkey-data:/data
geoipupdate:
image: ghcr.io/maxmind/geoipupdate:v7.1
restart: unless-stopped
logging: *default-logging
networks:
- geoipupdate
env_file:
- ./geoip.env
environment:
- GEOIPUPDATE_EDITION_IDS=GeoLite2-City GeoLite2-ASN
- GEOIPUPDATE_FREQUENCY=24
- GEOIPUPDATE_VERBOSE=1
volumes:
- geoip-data:/usr/share/GeoIP
cron:
build: ./services/cron
restart: unless-stopped
network_mode: "none"
logging: *default-logging
volumes:
- ./devrepo:/repo-volume
mirrorbits:
build: ./services/mirrorbits
restart: unless-stopped
logging: *default-logging
depends_on:
- valkey
- geoipupdate
networks:
- mirrorbits
- mirrorbits-valkey
volumes:
- geoip-data:/usr/share/GeoIP:ro
- ./devrepo:/repo-volume:ro
- ./services/mirrorbits/mirrorbits.conf:/etc/mirrorbits.conf:ro
- ./services/mirrorbits/add_mirrors.sh:/add_mirrors.sh:ro
labels:
- "traefik.enable=true"
- "traefik.docker.network=msys2-repo-dev_mirrorbits"
- "traefik.http.middlewares.mirrorbits-legacy-mingw32-redir.redirectregex.regex=^http(s?)://([^/]*)/mingw/i686($$|/.*)"
- "traefik.http.middlewares.mirrorbits-legacy-mingw32-redir.redirectregex.replacement=http$${1}://$${2}/mingw/mingw32$${3}"
- "traefik.http.middlewares.mirrorbits-legacy-mingw64-redir.redirectregex.regex=^http(s?)://([^/]*)/mingw/x86_64($$|/.*)"
- "traefik.http.middlewares.mirrorbits-legacy-mingw64-redir.redirectregex.replacement=http$${1}://$${2}/mingw/mingw64$${3}"
# http
- "traefik.http.routers.mirrorbits.rule=Host(`mirror.localhost`)"
- "traefik.http.routers.mirrorbits.entrypoints=web"
- "traefik.http.routers.mirrorbits.middlewares=mirrorbits-legacy-mingw32-redir,mirrorbits-legacy-mingw64-redir"
volumes:
staging-gnupg:
staging-repos:
geoip-data:
valkey-data:
networks:
default:
docker-socket-proxy:
internal: true
rsync:
internal: true
mirrorbits:
mirrorbits-valkey:
internal: true
geoipupdate:
stagingrepo:
internal: true
staging:
repo:
internal: true
packages:
stats:
internal: true