Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
283 lines (266 loc) · 8.23 KB
/
Copy pathcompose.yaml
File metadata and controls
283 lines (266 loc) · 8.23 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
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
name: tresso
x-api-env: &api-env
APP_ENV: dev
DATABASE_URL: postgresql://app:app@postgres:5432/app?serverVersion=18&charset=utf8
MESSENGER_TRANSPORT_DSN: redis://redis:6379/messages
REDIS_URL: redis://redis:6379
S3_ENDPOINT: http://s3:9000
S3_BUCKET: mail
S3_ACCESS_KEY: devaccesskey
S3_SECRET_KEY: devsecretkey
MEILISEARCH_URL: http://meilisearch:7700
MEILISEARCH_KEY: dev-master-key-change-me
# Empty unless the scan profile runs ClamAV (see README): attachments are then marked as not scanned, and open
# after a warning.
CLAMAV_HOST: ${CLAMAV_HOST:-}
CLAMAV_PORT: "3310"
MAILER_DSN: smtp://mailpit:1025
SYNC_WORKER_CLIENT_SECRET: dev-sync-worker-secret
# Realtime hub; development keys only.
MERCURE_PUBLIC_URL: http://localhost:8080/.well-known/mercure
MERCURE_INTERNAL_URL: http://api/.well-known/mercure
MERCURE_PUBLISHER_JWT_KEY: dev-mercure-publisher-key-change-me-0123456789
MERCURE_SUBSCRIBER_JWT_KEY: dev-mercure-subscriber-key-change-me-012345678
MERCURE_CORS_ORIGINS: http://localhost:5173 tauri://localhost http://tauri.localhost
# Web Push and notification sender; development keys only.
WEB_PUSH_PUBLIC_KEY: BJZGnmWrmrx-tp6kSVq5BcoG7ls4fec1GtNApoq5VwurMGOWVJWC6uvYl_iKw7XaBZGqwxxMwR7-rz2_QYdGo_k
WEB_PUSH_PRIVATE_KEY: ebvbvaK9hI8Y0jN1-Vlokj2DY82hSiZiwM5uTIgNkMY
WEB_PUSH_SUBJECT: mailto:dev@localhost
NOTIFICATIONS_FROM: Tresso <notifications@localhost>
services:
api:
build:
context: .
dockerfile: docker/api/Dockerfile
target: dev
environment:
<<: *api-env
RUN_MIGRATIONS: "1"
volumes:
- ./apps/api:/app
- caddy_data:/data
- caddy_config:/config
ports:
- "8080:80"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost/health"]
interval: 10s
timeout: 3s
retries: 30
start_period: 120s
messenger:
build:
context: .
dockerfile: docker/api/Dockerfile
target: dev
command: ["php", "bin/console", "messenger:consume", "async", "search", "push", "scheduler_notifications", "scheduler_batches", "scheduler_daily_brief", "--time-limit=3600", "--memory-limit=256M", "-vv"]
environment: *api-env
volumes:
- ./apps/api:/app
depends_on:
api:
condition: service_healthy
# The image's healthcheck probes the FrankenPHP admin endpoint, which this console process does not serve.
# The container exits when the consumer stops, and restart brings it back.
healthcheck:
disable: true
restart: unless-stopped
# The sweeps and nightly purges (scheduler_default) have their own consumer: a sweep with much to delete must never
# hold up sending.
maintenance:
build:
context: .
dockerfile: docker/api/Dockerfile
target: dev
command: ["php", "bin/console", "messenger:consume", "scheduler_default", "--time-limit=3600", "--memory-limit=256M", "-vv"]
environment: *api-env
volumes:
- ./apps/api:/app
depends_on:
api:
condition: service_healthy
healthcheck:
disable: true
restart: unless-stopped
# Classification has its own consumer: a first sync classifies a whole mailbox, which must never hold up sending.
classifier:
build:
context: .
dockerfile: docker/api/Dockerfile
target: dev
command: ["php", "bin/console", "messenger:consume", "classify", "--time-limit=3600", "--memory-limit=256M", "-vv"]
environment: *api-env
volumes:
- ./apps/api:/app
depends_on:
api:
condition: service_healthy
healthcheck:
disable: true
restart: unless-stopped
# Scans wait on clamd, so they have their own worker: outgoing mail never waits behind them. First scans go before
# rescans.
scanner:
build:
context: .
dockerfile: docker/api/Dockerfile
target: dev
command: ["php", "bin/console", "messenger:consume", "scan", "scan_rescan", "--time-limit=3600", "--memory-limit=256M", "-vv"]
environment: *api-env
volumes:
- ./apps/api:/app
depends_on:
api:
condition: service_healthy
healthcheck:
disable: true
restart: unless-stopped
# Bulk actions have their own consumer too: archiving a whole smart inbox must never hold up sending.
bulk:
build:
context: .
dockerfile: docker/api/Dockerfile
target: dev
command: ["php", "bin/console", "messenger:consume", "bulk", "--time-limit=3600", "--memory-limit=256M", "-vv"]
environment: *api-env
volumes:
- ./apps/api:/app
depends_on:
api:
condition: service_healthy
healthcheck:
disable: true
restart: unless-stopped
# Background re-encryption has its own consumer: moving a mailbox to a new key must never hold up mail or pushes.
reencrypt:
build:
context: .
dockerfile: docker/api/Dockerfile
target: dev
command: ["php", "bin/console", "messenger:consume", "reencrypt", "--time-limit=3600", "--memory-limit=256M", "-vv"]
environment: *api-env
volumes:
- ./apps/api:/app
depends_on:
api:
condition: service_healthy
healthcheck:
disable: true
restart: unless-stopped
sync:
build:
context: .
dockerfile: docker/sync/Dockerfile
target: dev
environment:
API_URL: http://api
OAUTH_TOKEN_URL: http://api/oauth/token
OAUTH_CLIENT_ID: sync-worker
OAUTH_CLIENT_SECRET: dev-sync-worker-secret
S3_ENDPOINT: http://s3:9000
S3_BUCKET: mail
S3_ACCESS_KEY: devaccesskey
S3_SECRET_KEY: devsecretkey
WORKER_ID: sync-dev-1
HEARTBEAT_INTERVAL: 10s
# Development only: lets the worker reach the GreenMail test server on the Docker network.
MAIL_ALLOW_UNSAFE_SERVERS: "1"
volumes:
- ./apps/sync:/src
- go_cache:/root/.cache/go-build
- go_mod:/go/pkg/mod
depends_on:
api:
condition: service_healthy
restart: unless-stopped
postgres:
image: postgres:18-alpine
environment:
POSTGRES_DB: app
POSTGRES_USER: app
POSTGRES_PASSWORD: app
ports:
- "54320:5432"
volumes:
- postgres_data:/var/lib/postgresql
healthcheck:
test: ["CMD", "pg_isready", "-d", "app", "-U", "app"]
interval: 5s
timeout: 5s
retries: 20
redis:
image: redis:8.8-alpine
ports:
- "63790:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
s3:
image: rustfs/rustfs:1.0.3
environment:
RUSTFS_ACCESS_KEY: devaccesskey
RUSTFS_SECRET_KEY: devsecretkey
RUSTFS_CONSOLE_ENABLE: "true"
ports:
- "9000:9000"
- "9001:9001"
volumes:
- s3_data:/data
meilisearch:
image: getmeili/meilisearch:v1.55
environment:
MEILI_MASTER_KEY: dev-master-key-change-me
MEILI_NO_ANALYTICS: "true"
ports:
- "7700:7700"
volumes:
- meili_data:/meili_data
mailpit:
image: axllent/mailpit:v1.31
ports:
- "8025:8025"
- "1025:1025"
# Local IMAP/SMTP test server with two fixed mailboxes; never a real mailbox in development or CI.
# In the app: host "greenmail", IMAP 3143 / SMTP 3025 with security "none", or IMAPS 3993 / SMTPS 3465 with "tls"
# (self-signed). Log in with the full email address.
greenmail:
image: greenmail/standalone:2.1.14
environment:
GREENMAIL_OPTS: >-
-Dgreenmail.setup.test.all
-Dgreenmail.hostname=0.0.0.0
-Dgreenmail.users.login=email
-Dgreenmail.users=kim@tresso.test:dev-password-kim,lisa@tresso.test:dev-password-lisa
-Dgreenmail.verbose=false
ports:
- "3143:3143"
- "3993:3993"
- "3025:3025"
- "3465:3465"
- "18080:8080"
# ClamAV needs about 1.5 GB of RAM, so it only starts with: CLAMAV_HOST=clamav docker compose --profile scan up
clamav:
image: clamav/clamav:1.5-debian13-slim
profiles: ["scan"]
volumes:
- clamav_data:/var/lib/clamav
- ./docker/clamav/clamd.conf:/etc/clamav/clamd.conf:ro
volumes:
postgres_data:
redis_data:
s3_data:
meili_data:
clamav_data:
caddy_data:
caddy_config:
go_cache:
go_mod: