feat: add production deployment and runtime safeguards

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Gustavo
2026-09-28 15:48:44 -03:00
co-authored by Claude Sonnet 5
parent 8ce2fcdfea
commit a9ef4d776d
23 changed files with 1696 additions and 8 deletions
+40
View File
@@ -0,0 +1,40 @@
services:
app:
build: .
restart: unless-stopped
env_file:
- .env.production
environment:
- APP_HOST=0.0.0.0
- APP_PORT=3910
- APP_DB_PATH=/app/data/maquina-pessoal.db
- APP_WHATSAPP_AUTH_DIR=/app/data/runtime/whatsapp-auth
- CNPJ_BASE_DIR=/app/prospeccao/cnpj
volumes:
- ./data:/app/data
expose:
- "3910"
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3910/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
caddy:
image: caddy:2-alpine
restart: unless-stopped
depends_on:
app:
condition: service_healthy
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
volumes:
caddy_data:
caddy_config: