-
-
Notifications
You must be signed in to change notification settings - Fork 303
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
218 lines (217 loc) · 5.78 KB
/
docker-compose.yml
File metadata and controls
218 lines (217 loc) · 5.78 KB
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
x-logging:
&default-logging
driver: "json-file"
options:
max-size: "150m"
max-file: "2"
services:
nginx:
image: nginx:1.28.1
logging: *default-logging
restart: unless-stopped
ports:
- "${PORT:-80}:80"
- "${PORT:-443:443}"
depends_on:
web:
condition: service_healthy
anubis:
condition: service_healthy
networks:
- main
environment:
- DOMAIN=${DOMAIN}
- MAX_UPLOAD_MiB=${DATA_UPLOAD_MAX_MEMORY_MiB:-100}
volumes:
- ./nginx/${NGINX_SETUP:-https}.conf:/etc/nginx/templates/default.conf.template
- ./nginx/server_config:/etc/nginx/templates/server_config.template
- ./nginx/server_name:/etc/nginx/templates/server_name.template
- ./nginx/locations:/etc/nginx/conf.d/locations
- ./nginx/99-autoreload.sh:/docker-entrypoint.d/99-autoreload.sh
- ./certbot/conf:/etc/nginx/ssl
- ./certbot/data:/var/www/certbot
- static_volume:/app/static
- media_volume:/app/images
anubis:
image: ghcr.io/techarohq/anubis:latest
restart: unless-stopped
environment:
BIND: ":8000"
DIFFICULTY: "4"
METRICS_BIND: ":9090"
SERVE_ROBOTS_TXT: "true"
TARGET: " "
POLICY_FNAME: "/data/cfg/botPolicy.yaml"
OG_PASSTHROUGH: "true"
OG_EXPIRY_TIME: "24h"
healthcheck:
test: ["CMD", "anubis", "--healthcheck"]
interval: 5s
timeout: 30s
retries: 5
start_period: 500ms
networks:
- main
volumes:
- "./anubis/botPolicy.yaml:/data/cfg/botPolicy.yaml:ro"
certbot:
image: certbot/certbot:latest
restart: unless-stopped
entrypoint: /bin/sh -c "trap exit TERM; while [ "${NGINX_SETUP:-https}" = "https" ];do certbot renew --webroot --webroot-path=/var/www/certbot; sleep 1d & wait $${!}; done"
depends_on:
- nginx
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/logs:/var/log/letsencrypt
- ./certbot/data:/var/www/certbot
db-backup-job:
build: postgres-docker
environment:
- DEBUG=${DEBUG}
- PGPASSWORD=${POSTGRES_PASSWORD}
- PGHOST=${POSTGRES_HOST}
- PGUSER=${POSTGRES_USER}
- PGDATABASE=${POSTGRES_DB}
depends_on:
db:
condition: service_started
volumes:
- backups:/backups
networks:
- main
db:
image: postgres:17
restart: unless-stopped
shm_size: ${POSTGRES_SHM_SIZE:-128mb}
env_file: .env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
retries: 5
start_period: 5s
timeout: 10s
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- main
web:
build: .
restart: unless-stopped
env_file: .env
command: gunicorn bookwyrm.wsgi:application
volumes:
- static_volume:/app/static
- media_volume:/app/images
- exports_volume:/app/exports
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000"]
interval: 3s
timeout: 1s
start_period: 3s
retries: 25
depends_on:
db:
condition: service_healthy
redis_activity:
condition: service_started
networks:
- main
redis_activity:
image: redis:7.2.1
command: redis-server --requirepass ${REDIS_ACTIVITY_PASSWORD} --appendonly yes --port ${REDIS_ACTIVITY_PORT}
logging: *default-logging
volumes:
- ./redis.conf:/etc/redis/redis.conf
- redis_activity_data:/data
env_file: .env
networks:
- main
restart: unless-stopped
redis_broker:
image: redis:7.2.1
command: redis-server --requirepass ${REDIS_BROKER_PASSWORD} --appendonly yes --port ${REDIS_BROKER_PORT}
logging: *default-logging
volumes:
- ./redis.conf:/etc/redis/redis.conf
- redis_broker_data:/data
env_file: .env
networks:
- main
restart: unless-stopped
celery_worker:
env_file: .env
build: .
networks:
- main
command: celery -A celerywyrm worker --autoscale=10,1 -l info -Q high_priority,medium_priority,low_priority,streams,images,suggested_users,email,connectors,lists,inbox,imports,import_triggered,broadcast,misc
healthcheck:
test: celery -A celerywyrm status
interval: 10s
timeout: 10s
start_period: 2s
retries: 6
volumes:
- static_volume:/app/static
- media_volume:/app/images
- exports_volume:/app/exports
depends_on:
web:
condition: service_healthy
db:
condition: service_healthy
redis_broker:
condition: service_started
restart: unless-stopped
celery_beat:
env_file: .env
build: .
networks:
- main
command: celery -A celerywyrm beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
healthcheck:
test: celery -A celerywyrm status
interval: 10s
timeout: 10s
retries: 6
start_period: 2s
volumes:
- static_volume:/app/static
- media_volume:/app/images
- exports_volume:/app/exports
depends_on:
celery_worker:
condition: service_healthy
restart: unless-stopped
flower:
build: .
command: celery -A celerywyrm flower --basic_auth=${FLOWER_USER}:${FLOWER_PASSWORD} --url_prefix=flower
healthcheck:
test: celery -A celerywyrm status
interval: 10s
timeout: 10s
retries: 6
start_period: 2s
env_file: .env
volumes:
- static_volume:/app/static
networks:
- main
depends_on:
db:
condition: service_healthy
redis_broker:
condition: service_started
web:
condition: service_healthy
restart: unless-stopped
volumes:
pgdata:
backups:
static_volume:
media_volume:
exports_volume:
redis_broker_data:
redis_activity_data:
networks:
main:
enable_ipv6: true