scaffold: Docker infrastructure — Compose, Nginx, NATS, Dockerfile

4-service stack (PostgreSQL 16, NATS JetStream, Rust API, Nginx),
multi-stage Rust build with dependency caching, wildcard subdomain
routing for public sites, WebSocket support, rate limiting zones.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell
2026-02-14 21:42:15 -05:00
parent 5b18a52634
commit 175d6f0a7b
4 changed files with 310 additions and 0 deletions

35
docker/nats.conf Normal file
View File

@@ -0,0 +1,35 @@
# Corrosion NATS Configuration
# JetStream enabled for persistent messaging
listen: 0.0.0.0:4222
# JetStream configuration
jetstream {
store_dir: /data
max_mem: 256MB
max_file: 2GB
}
# WebSocket listener for frontend real-time updates
websocket {
listen: "0.0.0.0:9222"
no_tls: true # TLS terminated at Nginx/Cloudflare
}
# HTTP monitoring
http: 0.0.0.0:8222
# Logging
debug: false
trace: false
logtime: true
# Limits
max_payload: 8MB # Support map file transfer metadata
max_connections: 10000
# Authorization — tokens validated per-connection
# Plugin and companion agents authenticate with license-specific tokens
authorization {
timeout: 5
}