77 lines
886 B
Markdown
77 lines
886 B
Markdown
|
|
# AZA Deployment Runbook
|
||
|
|
|
||
|
|
Step 15: Reverse Proxy + HTTPS readiness
|
||
|
|
|
||
|
|
Goal:
|
||
|
|
Prepare infrastructure for production deployment.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Start Backend
|
||
|
|
|
||
|
|
Use existing script:
|
||
|
|
|
||
|
|
deploy/local_reset_and_start.ps1
|
||
|
|
|
||
|
|
or run backend normally.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Start Caddy
|
||
|
|
|
||
|
|
Install Caddy if needed.
|
||
|
|
|
||
|
|
Then run:
|
||
|
|
|
||
|
|
caddy run --config deploy/Caddyfile
|
||
|
|
|
||
|
|
Local proxy will be available at:
|
||
|
|
|
||
|
|
http://localhost:8080
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Health Check
|
||
|
|
|
||
|
|
Run:
|
||
|
|
|
||
|
|
deploy/healthcheck.ps1
|
||
|
|
|
||
|
|
or
|
||
|
|
|
||
|
|
deploy/healthcheck.ps1 -BaseUrl http://localhost:8080
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Production Setup (later)
|
||
|
|
|
||
|
|
When domain exists:
|
||
|
|
|
||
|
|
Set ENV variables:
|
||
|
|
|
||
|
|
DOMAIN=example.com
|
||
|
|
EMAIL=admin@example.com
|
||
|
|
BACKEND_UPSTREAM=backend:8000
|
||
|
|
|
||
|
|
Then restart Caddy.
|
||
|
|
|
||
|
|
Caddy automatically provisions HTTPS certificates.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Logs
|
||
|
|
|
||
|
|
Caddy logs to stdout.
|
||
|
|
|
||
|
|
Backend logs as before.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Update Procedure
|
||
|
|
|
||
|
|
1 Stop services
|
||
|
|
2 Update code
|
||
|
|
3 Restart backend
|
||
|
|
4 Restart Caddy
|
||
|
|
5 Run healthcheck
|