Docker Compose deployment
Mount /app/data to a persistent host volume so your SQLite database, JWT secret, DKIM keys, and raw .eml blobs survive container upgrades.
docker-compose.yml
services:
zinq-web:
build: .
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000"
env_file: .env.production
volumes:
- ./zinq-data:/app/data
zinq-mail:
build: .
command: ["npm", "run", "smtp"]
restart: unless-stopped
ports:
- "25:25"
- "465:465"
- "587:587"
- "143:143"
- "993:993"
env_file: .env.production
volumes:
- ./zinq-data:/app/dataReverse proxy & IP rate limiting
When running behind Caddy, Nginx, or Cloudflare, set TRUSTED_PROXY_COUNT to the exact number of hops in front of Next.js. Zinq reads the rightmost trusted X-Forwarded-For entry so clients cannot spoof rate-limit keys.
Bind Next.js to localhost
Expose port 3000 only to 127.0.0.1 and terminate HTTPS at Caddy or Nginx so session cookies and /.well-known/mta-sts.txt are served over TLS.