Covers phases 1-2 of the build order in the architecture spec: the IMAP sync engine (IDLE + UIDVALIDITY tracking + jittered reconnect, headers first with lazy body fetch), the full data model, and a minimal REST API for auth, accounts, folders, messages and delta polling. Credentials are encrypted at rest with ChaCha20-Poly1305 rather than libsodium secretbox, to avoid a system dependency for the same construction. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
51 lines
1.1 KiB
YAML
51 lines
1.1 KiB
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: tern
|
|
POSTGRES_PASSWORD: tern
|
|
POSTGRES_DB: tern
|
|
volumes:
|
|
- db-data:/var/lib/postgresql/data
|
|
ports:
|
|
- "127.0.0.1:5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U tern"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
server:
|
|
build: .
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
DATABASE_URL: postgres://tern:tern@db:5432/tern
|
|
BIND_ADDR: 0.0.0.0:8080
|
|
CREDENTIAL_KEY: ${CREDENTIAL_KEY}
|
|
BLOB_STORAGE_DIR: /data/blobs
|
|
RUST_LOG: tern_server=info
|
|
volumes:
|
|
- blob-data:/data/blobs
|
|
# Not published directly — nginx is the only thing that should be
|
|
# reachable from outside (server-architecture-spec.md §7).
|
|
expose:
|
|
- "8080"
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- server
|
|
ports:
|
|
- "80:80"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
|
|
volumes:
|
|
db-data:
|
|
blob-data:
|