forked from truespar/sentio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
213 lines (199 loc) · 7.86 KB
/
Copy pathdocker-compose.yml
File metadata and controls
213 lines (199 loc) · 7.86 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
# ─────────────────────────────────────────────────────────────────────────────
# Sentio SMTP - OSS quickstart docker-compose stack
#
# docker compose up -d # pull the published image + start everything
# docker compose logs -f sentio # tail app logs
# docker compose down -v # stop and wipe volumes
#
# What runs:
# sentio - the SMTP + REST API server (ports 25, 465, 587, 8080)
# sentio-migrate - one-shot: applies DB migrations + seeds bootstrap tenant
# postgres - application state (tenants, messages, credentials, …)
# redis - KV backend (rate limits, greylist, bans, rspamd Bayes)
# nats - JetStream (queue + delivery pipeline)
# minio - S3-compatible blob storage for raw .eml / attachments
# minio-init - one-shot: creates the sentio-attachments bucket
# clamav - antivirus (attachment scanning, port 3310)
# rspamd - spam scorer (port 11333)
#
# Bootstrap credentials (migration 007 auto-seeds these):
# Tenant ID : 00000000-0000-0000-0000-000000000001 ("Sentio Platform")
# API key : sentio_bootstrap_admin_CHANGE_ME
#
# ⚠ Rotate the API key immediately if this host is reachable from the
# internet. See README-docker.md.
#
# DNS / DNSBL note:
# Sentio and rspamd use Docker's embedded DNS by default. Spamhaus
# (zen.spamhaus.org, dbl.spamhaus.org) refuses queries from shared public
# resolvers and will return 127.255.255.254 under real volume. For
# production, either (a) register a free Spamhaus Data Query Service key
# and rewrite the DNSBL lists to use <key>.zen.dq.spamhaus.net, or
# (b) add an unbound recursive resolver service and point everything at it.
# ─────────────────────────────────────────────────────────────────────────────
name: sentio-oss
x-sentio-env: &sentio-env
RUST_LOG: info
SENTIO__DATABASE__URL: "postgres://sentio:sentio@postgres:5432/sentio"
SENTIO__KV__BACKEND: "redis"
SENTIO__REDIS__URL: "redis://redis:6379/0"
SENTIO__NATS__URL: "nats://nats:4222"
SENTIO__STORAGE__ENDPOINT_URL: "http://minio:9000"
SENTIO__STORAGE__ACCESS_KEY: "sentio-dev"
SENTIO__STORAGE__SECRET_KEY: "sentio-dev-secret-CHANGE_ME"
SENTIO__STORAGE__BUCKET: "sentio-attachments"
SENTIO__SCANNING__CLAMD_HOST: "clamav:3310"
SENTIO__SPAM__RSPAMD__URL: "http://rspamd:11333"
services:
# ── Data plane ──────────────────────────────────────────────────────────
postgres:
image: postgres:18-alpine
restart: unless-stopped
environment:
POSTGRES_USER: sentio
POSTGRES_PASSWORD: sentio
POSTGRES_DB: sentio
volumes:
# PG18+ images store data in a major-version subdirectory and reject a
# mount at /var/lib/postgresql/data. Mount the parent instead.
- postgres_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sentio -d sentio"]
interval: 5s
timeout: 5s
retries: 20
networks: [sentio_net]
redis:
image: redis:8-alpine
restart: unless-stopped
command: ["redis-server", "--save", "60", "1000", "--appendonly", "yes"]
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
networks: [sentio_net]
nats:
image: nats:2.11-alpine
restart: unless-stopped
command: ["-c", "/etc/nats/nats-server.conf"]
volumes:
- ./docker/nats/nats-server.conf:/etc/nats/nats-server.conf:ro
- nats_data:/data
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://localhost:8222/healthz | grep -q ok"]
interval: 5s
timeout: 3s
retries: 20
networks: [sentio_net]
minio:
image: quay.io/minio/minio:latest
restart: unless-stopped
command: ["server", "/data", "--console-address", ":9001"]
environment:
MINIO_ROOT_USER: "sentio-dev"
MINIO_ROOT_PASSWORD: "sentio-dev-secret-CHANGE_ME"
volumes:
- minio_data:/data
ports:
- "9001:9001" # web console (optional; comment out to hide)
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:9000/minio/health/ready"]
interval: 5s
timeout: 3s
retries: 20
networks: [sentio_net]
minio-init:
image: quay.io/minio/mc:latest
restart: "no"
depends_on:
minio: { condition: service_healthy }
environment:
MINIO_URL: "http://minio:9000"
MINIO_ROOT_USER: "sentio-dev"
MINIO_ROOT_PASSWORD: "sentio-dev-secret-CHANGE_ME"
SENTIO_BUCKET: "sentio-attachments"
volumes:
- ./docker/minio/init.sh:/init.sh:ro
entrypoint: ["/bin/sh", "/init.sh"]
networks: [sentio_net]
# ── Content scanners ────────────────────────────────────────────────────
clamav:
image: clamav/clamav:1.5.4
restart: unless-stopped
environment:
# Signature checks per day. The image defaults to 1, which can leave the
# scanner a full day behind; the feed publishes several times daily.
FRESHCLAM_CHECKS: "24"
volumes:
- clamav_data:/var/lib/clamav
healthcheck:
test: ["CMD", "clamdcheck.sh"]
interval: 30s
timeout: 10s
retries: 20
start_period: 300s # freshclam DB download can take a while
networks: [sentio_net]
rspamd:
image: rspamd/rspamd:latest
restart: unless-stopped
depends_on:
redis: { condition: service_healthy }
volumes:
- ./docker/rspamd/local.d:/etc/rspamd/local.d:ro
- rspamd_data:/var/lib/rspamd
healthcheck:
test: ["CMD", "rspamadm", "control", "stat"]
interval: 10s
timeout: 5s
retries: 10
networks: [sentio_net]
# ── One-shot: run migrations + seed bootstrap tenant + API key ──────────
sentio-migrate:
image: ghcr.io/truespar/sentio:${SENTIO_TAG:-latest}
restart: "no"
depends_on:
postgres: { condition: service_healthy }
environment:
<<: *sentio-env
command: ["--config", "/etc/sentio/oss.toml", "migrate"]
networks: [sentio_net]
# ── The application ─────────────────────────────────────────────────────
sentio:
image: ghcr.io/truespar/sentio:${SENTIO_TAG:-latest}
restart: unless-stopped
depends_on:
sentio-migrate: { condition: service_completed_successfully }
postgres: { condition: service_healthy }
redis: { condition: service_healthy }
nats: { condition: service_healthy }
minio-init: { condition: service_completed_successfully }
clamav: { condition: service_healthy }
rspamd: { condition: service_healthy }
environment:
<<: *sentio-env
ports:
- "25:25" # SMTP MX (edit / remove for laptops behind NAT)
- "465:465" # SMTPS
- "587:587" # Submission (STARTTLS)
- "8080:8080" # REST API
# - "9090:9090" # Prometheus metrics - unauth; keep internal
volumes:
- sentio_data:/var/lib/sentio
# Mount your own cert bundle at /etc/sentio/tls/ to enable STARTTLS +
# implicit TLS. Without these files Sentio runs plain SMTP only.
# - ./tls:/etc/sentio/tls:ro
networks: [sentio_net]
volumes:
postgres_data:
redis_data:
nats_data:
minio_data:
clamav_data:
rspamd_data:
sentio_data:
networks:
sentio_net:
driver: bridge