26 lines
621 B
Markdown
26 lines
621 B
Markdown
# Deploy
|
|
|
|
Provisions a DO droplet + reserved IP + firewall + monitoring, builds the
|
|
Next.js image locally on the droplet, runs it behind Caddy.
|
|
|
|
## Deploy from scratch
|
|
|
|
```bash
|
|
cd terraform
|
|
infisical login
|
|
export INFISICAL_PROJECT_ID=<aibook-fun-project-id>
|
|
./itofu.sh init && ./itofu.sh plan && ./itofu.sh apply
|
|
./itofu.sh output -raw droplet_ip
|
|
|
|
# add Cloudflare A record: aibook.fun → <that-ip>
|
|
|
|
cd ..
|
|
ansible-playbook -i 'root@<that-ip>,' ansible/deploy.yml
|
|
```
|
|
|
|
## Structure
|
|
|
|
- `terraform/` — droplet + IP + firewall + monitoring
|
|
- `docker/` — Dockerfile + compose + Caddy
|
|
- `ansible/` — droplet convergence
|