-
Notifications
You must be signed in to change notification settings - Fork 64
/
docker-stack.yml
228 lines (219 loc) · 5.1 KB
/
docker-stack.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
version: '3.7'
services:
# An nginx/LetsEncrypt reverse proxy for handling SSL offloading and traffic routing
swag:
image: ghcr.io/linuxserver/swag
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- URL=mod.gg
- SUBDOMAINS=portainer,www,repl,stats,db,webhook,logs,modmail,beta
- VALIDATION=http
- EMAIL=certs@cisien.com
- ONLY_SUBDOMAINS=false
- STAGING=false
deploy:
mode: replicated
replicas: 1
resources:
limits:
cpus: '1'
memory: 500M
reservations:
cpus: '0.5'
memory: 20M
volumes:
- swag-config:/config
ports:
- 443:443
- 80:80
networks:
- proxy
- portainer_agent_network
# c# repl service
repl:
image: ghcr.io/discord-csharp/csharprepl:latest
read_only: true
user: www-data
environment:
- ASPNETCORE_URLS=http://+:31337
- Logging__LogLevel__Microsoft=Warning
- Logging__LogLevel__CSDiscordService=Trace
deploy:
replicas: 5
mode: replicated
update_config:
parallelism: 2
delay: 0s
order: start-first
restart_policy:
condition: any
delay: 0s
resources:
limits:
cpus: '1'
memory: 500M
reservations:
cpus: '0.25'
memory: 20M
volumes:
- repl-tmp:/tmp
- repl-var:/var
networks:
- repl
# the modix bot
modix:
image: ghcr.io/discord-csharp/modix:main
environment:
COREHOST_TRACE: '0'
MessageCacheSize: '1000'
MODIX_DiscordClientId: '550841992809152542'
MODIX_LogWebhookId: '382609729802862592'
MODIX_ReplUrl: http://repl:31337/eval
MODIX_IlUrl: http://repl:31337/il
deploy:
mode: replicated
replicas: 1
update_config:
delay: 0s
order: stop-first
restart_policy:
condition: any
delay: 0s
secrets:
- source: discord-bot-token
target: DiscordToken
- source: discord-client-secret
target: DiscordClientSecret
- source: db-connection-string
target: DbConnection
- source: log-webhook-token
target: LogWebhookToken
volumes:
- modix-keys:/app/dataprotection
- modix-logs:/app/logs
networks:
- proxy
- repl
- modix
# the translation feature of the modix bot
modix-translator:
image: ghcr.io/discord-csharp/modix-translator:latest
environment:
COREHOST_TRACE: '0'
deploy:
mode: replicated
replicas: 1
update_config:
delay: 0s
order: stop-first
restart_policy:
condition: any
delay: 0s
secrets:
- source: discord-bot-token
target: DISCORDTOKEN
- source: azure-translation-service-key-a
target: AZURETRANSLATIONKEY
# pgadmin instance with access to the modix instance
db-admin:
image: dpage/pgadmin4:latest
environment:
- PGADMIN_DEFAULT_EMAIL=cisien@cisien.com
- PGADMIN_DEFAULT_PASSWORD=CHANGEME
deploy:
mode: replicated
replicas: 1
update_config:
parallelism: 1
delay: 0s
order: stop-first
restart_policy:
condition: any
delay: 0s
volumes:
- pgadmin-data:/var/lib/pgadmin
networks:
- proxy
# grafana instance with access to the modix database
stats:
image: grafana/grafana:latest
environment:
- GF_SERVER_ROOT_URL=https://stats.mod.gg
- GF_SECURITY_ADMIN_PASSWORD=CHANGEME
- GF_PATHS_CONFIG=/gfdata/grafana.ini
- GF_PATHS_DATA=/gfdata/data
- GF_PATHS_PROVISIONING=/gfdata/provisioning
- GF_DATABASE_TYPE=sqlite3
deploy:
mode: replicated
replicas: 1
update_config:
parallelism: 1
delay: 0s
order: stop-first
restart_policy:
condition: any
delay: 0s
volumes:
- grafana-data:/gfdata:rw
networks:
- proxy
# monitors the health check (specifically of REPL) and restarts the container
autoheal:
image: willfarrell/autoheal
deploy:
mode: global
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
proxy:
repl:
modix:
modix-20:
portainer_agent_network:
external:
name: portainer_agent_network
secrets:
discord-bot-token:
external: true
discord-client-secret:
external: true
stackoverflow-token:
external: true
db-connection-string:
external: true
log-webhook-token:
external: true
azure-translation-service-key-a:
external: true
modix-dev-token:
external: true
modix-20-bot-token:
external: true
modix-20-discord-clientsecret:
external: true
modix-20-db-connection-string-b:
external: true
modix-20-web-token-signing-secret:
external: true
volumes:
pgadmin-data:
grafana-data:
swag-config:
hastebin-data:
modix-keys:
modix-logs:
modix-20-keys:
#workaround for swarm not supporting tmpfs mounts
repl-tmp:
driver_opts:
type: tmpfs
device: tmpfs
repl-var:
driver_opts:
type: tmpfs
device: tmpfs