forked from neodb-social/neodb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
319 lines (296 loc) · 9.1 KB
/
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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# NEODB Docker Compose File
#
# Note: may not be secure for production usage, use at your own risk
#
# The following env variable are expected from .env or command line
# - NEODB_SECRET_KEY
# - NEODB_SITE_DOMAIN
# - NEODB_SITE_NAME
# - NEODB_DATA
x-shared:
neodb-service: &neodb-service
build: .
image: ${NEODB_IMAGE:-neodb/neodb:latest}
environment:
NEODB_DEBUG:
NEODB_SECRET_KEY:
NEODB_SITE_NAME:
NEODB_SITE_DOMAIN:
NEODB_SITE_INTRO:
NEODB_SITE_HEAD:
NEODB_SITE_LOGO:
NEODB_SITE_ICON:
NEODB_USER_ICON:
NEODB_SITE_LINKS:
NEODB_SITE_DESCRIPTION:
NEODB_ALTERNATIVE_DOMAINS:
NEODB_PREFERRED_LANGUAGES:
NEODB_ADMIN_USERNAMES:
NEODB_INVITE_ONLY:
NEODB_LOGIN_MASTODON_WHITELIST:
NEODB_MASTODON_CLIENT_SCOPE:
NEODB_DISABLE_DEFAULT_RELAY:
NEODB_DISABLE_CRON_JOBS:
NEODB_SEARCH_PEERS:
NEODB_MIN_MARKS_FOR_DISCOVER:
NEODB_DISCOVER_UPDATE_INTERVAL:
NEODB_DISCOVER_FILTER_LANGUAGE:
NEODB_DISCOVER_SHOW_LOCAL_ONLY:
NEODB_DISCOVER_SHOW_POPULAR_POSTS:
NEODB_SENTRY_DSN:
TAKAHE_SENTRY_DSN:
NEODB_SENTRY_SAMPLE_RATE:
NEODB_DB_URL: ${NEODB_DB_URL:-postgres://neodb:aubergine@neodb-db/neodb}
TAKAHE_DB_URL: ${TAKAHE_DB_URL:-postgres://takahe:aubergine@takahe-db/takahe}
NEODB_REDIS_URL: ${NEODB_REDIS_URL:-redis://redis:6379/0}
NEODB_SEARCH_URL: ${NEODB_SEARCH_URL:-typesense://user:eggplant@typesense:8108/catalog}
NEODB_EMAIL_URL:
NEODB_EMAIL_FROM: no-reply@${NEODB_SITE_DOMAIN}
NEODB_ENABLE_LOCAL_ONLY:
NEODB_ENABLE_LOGIN_BLUESKY:
NEODB_ENABLE_LOGIN_THREADS:
NEODB_EXTRA_APPS:
NEODB_FANOUT_LIMIT_DAYS:
TAKAHE_FANOUT_LIMIT_DAYS:
NEODB_DOWNLOADER_PROXY_LIST:
NEODB_DOWNLOADER_BACKUP_PROXY:
NEODB_DOWNLOADER_SAVE_DIR:
NEODB_MEDIA_ROOT: /www/m
NEODB_VENV: /neodb-venv
TAKAHE_SECRET_KEY: ${NEODB_SECRET_KEY}
TAKAHE_MAIN_DOMAIN: ${NEODB_SITE_DOMAIN}
TAKAHE_MEDIA_URL: https://${NEODB_SITE_DOMAIN}/media/
TAKAHE_EMAIL_FROM: no-reply@${NEODB_SITE_DOMAIN}
TAKAHE_DATABASE_SERVER: ${TAKAHE_DATABASE_SERVER:-postgres://takahe:aubergine@takahe-db/takahe}
TAKAHE_CACHES_DEFAULT: ${TAKAHE_CACHES_DEFAULT:-redis://redis:6379/0}
TAKAHE_MEDIA_BACKEND: local://www/media/
TAKAHE_MEDIA_ROOT: /www/media
TAKAHE_USE_PROXY_HEADERS: true
TAKAHE_ALLOW_USER_MIGRATION: true
TAKAHE_STATOR_CONCURRENCY: ${TAKAHE_STATOR_CONCURRENCY:-4}
TAKAHE_STATOR_CONCURRENCY_PER_MODEL: ${TAKAHE_STATOR_CONCURRENCY_PER_MODEL:-2}
TAKAHE_VAPID_PUBLIC_KEY:
TAKAHE_VAPID_PRIVATE_KEY:
TAKAHE_DEBUG: ${NEODB_DEBUG:-False}
TAKAHE_VENV: /takahe-venv
THREADS_APP_ID:
THREADS_APP_SECRET:
SPOTIFY_API_KEY:
TMDB_API_V3_KEY:
GOOGLE_API_KEY:
DISCOGS_API_KEY:
IGDB_API_CLIENT_ID:
IGDB_API_CLIENT_SECRET:
DISCORD_WEBHOOKS:
SLACK_API_TOKEN:
SSL_ONLY:
restart: "on-failure"
volumes:
- ${NEODB_DATA:-../data}/neodb-media:/www/m
- ${NEODB_DATA:-../data}/takahe-media:/www/media
- ${NEODB_DATA:-../data}/takahe-cache:/www/cache
- ${NEODB_DATA:-../data}/www-root:/www/root
depends_on:
- redis
- neodb-db
- typesense
- takahe-db
profiles:
- production
dev-neodb-service: &dev-neodb-service
<<: *neodb-service
# environment:
# NEODB_DEBUG: True
volumes:
- ${NEODB_DATA:-../data}/www-root:/www/root
- ${NEODB_DATA:-../data}/neodb-media:/www/m
- ${NEODB_DATA:-../data}/takahe-media:/www/media
- ${NEODB_DATA:-../data}/takahe-cache:/www/cache
- ${NEODB_DATA:-../data}/nginx-log:/var/log/nginx
- ${NEODB_SRC:-.}:/neodb
- ${TAKAHE_SRC:-./neodb-takahe}:/takahe
profiles:
- dev
services:
redis:
image: redis:alpine
command: redis-server --save 60 1 --loglevel warning
volumes:
- ${NEODB_DATA:-../data}/redis:/data
typesense:
image: typesense/typesense:${TYPESENSE_VERSION:-0.25.2}
restart: "on-failure"
# healthcheck:
# test: ['CMD', 'curl', '-vf', 'http://127.0.0.1:8108/health']
# ports:
# - "18108:8108"
environment:
GLOG_minloglevel: 2
volumes:
- ${NEODB_DATA:-../data}/typesense:/data
command: "--data-dir /data --api-key=eggplant"
neodb-db:
image: postgres:${POSTGRES_VERSION:-14-alpine}
healthcheck:
test: ["CMD", "pg_isready", "-U", "neodb"]
volumes:
- ${NEODB_DATA:-../data}/neodb-db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=neodb
- POSTGRES_USER=neodb
- POSTGRES_PASSWORD=aubergine
takahe-db:
image: postgres:${POSTGRES_VERSION:-14-alpine}
healthcheck:
test: ["CMD", "pg_isready", "-U", "takahe"]
volumes:
- ${NEODB_DATA:-../data}/takahe-db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=takahe
- POSTGRES_USER=takahe
- POSTGRES_PASSWORD=aubergine
migration:
<<: *neodb-service
restart: "no"
command: /bin/neodb-init
depends_on:
neodb-db:
condition: service_healthy
typesense:
condition: service_started
redis:
condition: service_started
takahe-db:
condition: service_healthy
neodb-web:
<<: *neodb-service
command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_WEB_WORKER_NUM:-8} --preload --max-requests 2000 --timeout 60 -b 0.0.0.0:8000
healthcheck:
test:
[
"CMD",
"wget",
"-qO/tmp/test",
"--header",
"X-Forwarded-Proto: https",
"http://127.0.0.1:8000/nodeinfo/2.0/",
]
depends_on:
migration:
condition: service_completed_successfully
neodb-web-api:
<<: *neodb-service
command: ${NEODB_VENV:-/neodb-venv}/bin/gunicorn boofilsic.wsgi -w ${NEODB_API_WORKER_NUM:-4} --preload --max-requests 2000 --timeout 30 -b 0.0.0.0:8000
healthcheck:
test:
[
"CMD",
"wget",
"-qO/tmp/test",
"--header",
"X-Forwarded-Proto: https",
"http://127.0.0.1:8000/nodeinfo/2.0/",
]
depends_on:
migration:
condition: service_completed_successfully
neodb-worker:
<<: *neodb-service
command: neodb-manage rqworker --with-scheduler import export mastodon fetch crawl ap cron
depends_on:
migration:
condition: service_completed_successfully
neodb-worker-extra:
<<: *neodb-service
command: neodb-manage rqworker-pool --num-workers ${NEODB_RQ_WORKER_NUM:-4} mastodon fetch crawl ap
depends_on:
migration:
condition: service_completed_successfully
takahe-web:
<<: *neodb-service
command: ${TAKAHE_VENV:-/takahe-venv}/bin/gunicorn --chdir /takahe takahe.wsgi -w ${TAKAHE_WEB_WORKER_NUM:-8} --max-requests 2000 --timeout 60 --preload -b 0.0.0.0:8000
healthcheck:
test:
[
"CMD",
"wget",
"-qO/tmp/test",
"--header",
"X-Forwarded-Proto: https",
"http://127.0.0.1:8000/api/v1/instance",
]
depends_on:
migration:
condition: service_completed_successfully
takahe-stator:
<<: *neodb-service
command: takahe-manage runstator
stop_signal: SIGINT
depends_on:
migration:
condition: service_completed_successfully
nginx:
<<: *neodb-service
user: "root:root"
command: nginx-start
environment:
NEODB_WEB_SERVER: neodb-web:8000
NEODB_API_SERVER: neodb-web-api:8000
TAKAHE_WEB_SERVER: takahe-web:8000
NGINX_CONF: /neodb/misc/nginx.conf.d/neodb.conf
depends_on:
takahe-web:
condition: service_started
neodb-web:
condition: service_started
ports:
- "${NEODB_PORT:-8000}:8000"
shell:
<<: *neodb-service
command: bash
profiles: ["tools"]
root:
<<: *neodb-service
command: bash
profiles: ["tools"]
user: "root:root"
dev-neodb-web:
<<: *dev-neodb-service
command: neodb-manage runserver 0.0.0.0:8000
stop_signal: SIGINT
dev-neodb-worker:
<<: *dev-neodb-service
command: neodb-manage rqworker-pool --num-workers 4 import export mastodon fetch crawl ap cron
# command: neodb-manage rqworker --with-scheduler import export mastodon fetch crawl ap cron
dev-takahe-web:
<<: *dev-neodb-service
command: takahe-manage runserver 0.0.0.0:8000
stop_signal: SIGINT
dev-takahe-stator:
<<: *dev-neodb-service
command: takahe-manage runstator
stop_signal: SIGINT
dev-nginx:
<<: *dev-neodb-service
user: "root:root"
command: nginx-start
environment:
NEODB_WEB_SERVER: dev-neodb-web:8000
TAKAHE_WEB_SERVER: dev-takahe-web:8000
NGINX_CONF: /neodb/misc/nginx.conf.d/neodb-dev.conf
depends_on:
dev-takahe-web:
condition: service_started
dev-neodb-web:
condition: service_started
ports:
- "${NEODB_PORT:-8000}:8000"
dev-shell:
<<: *dev-neodb-service
command: bash
profiles: ["tools"]
dev-root:
<<: *dev-neodb-service
command: bash
profiles: ["tools"]
user: "root:root"