Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions docs/deploy-prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ Walk me through these 5 phases:
- Commit with conventional commit messages (feat:, fix:, etc.)

### Phase 3: Provision server
- SSH into the server and install Docker
- Create /data/{postgres,redis,minio,caddy} directories
- Run `bootstrap-server.sh` on a fresh Debian 12 server (installs Docker, creates directories, starts platform services)
- Set up DNS A record: <your-domain.com> -> <server-ip>
- Generate a deploy SSH key pair
- Generate a deploy SSH key pair for the `deploy` user
- Run `verify-server.sh` to confirm the platform is healthy

### Phase 4: Deploy
- Configure GitHub Actions secrets (SERVER_HOST, SERVER_USER, SERVER_SSH_KEY, APP_DOMAIN, DATABASE_PASSWORD, MINIO_ROOT_USER, MINIO_ROOT_PASSWORD)
- SSH to server: create /opt/apps/<app-name>, clone the repo, create deploy/.env from deploy/env.template using credentials from /opt/platform/.env
- Configure GitHub Actions secrets (SERVER_HOST, SERVER_USER, SERVER_SSH_KEY, APP_DOMAIN)
- Push to main to trigger the deploy workflow
- The workflow will: build containers, start services with docker-compose.standalone.yml, run migrations inside the container, then health check
- The workflow will: verify .env exists, auto-create the app database, build containers, run migrations, health check, generate Caddyfile, reload Caddy
- Verify with: curl https://<your-domain.com>/health

### Phase 5: Configure CI/CD
Expand All @@ -47,8 +48,10 @@ Walk me through these 5 phases:

Important notes:
- The app-template already includes all deployment fixes (correct migration ordering, __init__.py, PYTHONPATH, alembic -c flag)
- Standalone mode uses docker-compose.standalone.yml which includes postgres, redis, minio, and caddy
- Migrations run AFTER containers start: docker compose exec app alembic -c app/alembic.ini upgrade head
- Multi-app mode uses deploy/docker-compose.yml which joins the shared `towlion` network (platform provides postgres, redis, minio, caddy)
- The deploy workflow auto-creates a per-app database (e.g., todo_app_db) — no manual DB setup needed
- Caddyfile is generated by the workflow (not symlinked) with the literal domain and project-prefixed container name
- deploy/.env must exist on the server before the first push — the workflow fails fast if missing
- requirements.txt must be at repo root (not app/) for the Dockerfile build context
```

Expand Down