Kairo-Jinkendo/docs/DEPLOYMENT.md
Lars 5cc9282b31
All checks were successful
Test Suite / lint-backend (push) Successful in 2s
Test Suite / build-frontend (push) Successful in 9s
Test Suite / deploy (push) Successful in 41s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / pytest-backend (push) Successful in 8s
Test Suite / k6 /api/health Baseline (push) Successful in 30s
Test Suite / playwright-smoke (push) Successful in 7s
CI: Deploy und alle Tests in test.yml (needs deploy), separate Deploy-Workflows entfernt.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 19:40:44 +02:00

91 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Deployment Kairo Jinkendo
**Stand:** 2026-07-04 (AP0.1)
**Server:** Raspberry Pi 5 (`192.168.2.49`) — gleicher Host wie Shinkan/Mitai
**Runner:** Gitea Actions (`/home/lars/gitea-runner/`)
---
## Port- und Pfad-Übersicht
| | Production | Development |
|---|------------|-------------|
| **Git-Branch** | `main` | `develop` |
| **Server-Verzeichnis** | `/home/lars/docker/kairo` | `/home/lars/docker/kairo-dev` |
| **Frontend-Port** | 3004 | 3097 |
| **Backend-Port** | 8004 | 8097 |
| **PostgreSQL** | nur im Container-Netz (Prod optional localhost:5436) | nur im Container-Netz |
| **Domain** | kairo.jinkendo.de | dev.kairo.jinkendo.de |
---
## Einmalige Server-Einrichtung
```bash
mkdir -p /home/lars/docker/kairo /home/lars/docker/kairo-dev
cd /home/lars/docker/kairo-dev
git clone http://192.168.2.144:3000/Lars/Kairo-Jinkendo.git .
git checkout develop
cp .env.example .env
# DB_PASSWORD setzen
cd /home/lars/docker/kairo
git clone http://192.168.2.144:3000/Lars/Kairo-Jinkendo.git .
git checkout main
cp .env.example .env
# Prod-DB_PASSWORD setzen
```
---
## Gitea Actions Checkliste
1. **Actions aktiviert** (Repository → Settings → Actions)
2. **Pi-Runner registriert** — derselbe wie Shinkan/Mitai (`ubuntu-latest`)
3. Push `develop``deploy-dev.yml``curl http://localhost:8097/api/health`
4. Merge `main``deploy-prod.yml``curl http://localhost:8004/api/health`
5. Nach Deploy: `test.yml` (workflow_run) — pytest, k6, Playwright smoke gegen **localhost**
| Workflow | Trigger | Jobs |
|----------|---------|------|
| `test.yml` | Push `develop` / `main` | lint, build → **deploy****pytest**, **k6**, **Playwright** |
| `test.yml` | Pull Request | lint, build, compose-smoke (+ pytest) |
Alle Integrationstests laufen im **selben** Workflow via `needs: deploy` — kein separates Deploy-Workflow mehr, kein `workflow_run`.
---
## Medien (optional)
Aktuell keine Medien-Speicherung. Bei Bedarf: NAS-Mount + `docker-compose.override.yml` (siehe frühere Doku-Version im Git-Verlauf).
---
## Reverse Proxy (optional)
| Hostname | Ziel (Pi) |
|----------|-----------|
| `kairo.jinkendo.de` | `http://192.168.2.49:3004` |
| `dev.kairo.jinkendo.de` | `http://192.168.2.49:3097` |
---
## Manuelles Deploy
```bash
# Development
cd /home/lars/docker/kairo-dev
git fetch origin develop && git reset --hard origin/develop
docker compose -f docker-compose.dev-env.yml build --no-cache
docker compose -f docker-compose.dev-env.yml up -d
# Production
cd /home/lars/docker/kairo
git fetch origin main && git reset --hard origin/main
docker compose build --no-cache
docker compose up -d
```
Health: `curl http://localhost:8097/api/health` (Dev) bzw. `http://localhost:8004/api/health` (Prod)