AP0.1: Backend, Frontend minimal, Tests und CI fuer Dev/Prod-Deploy.
Deploy Development / deploy (push) Successful in 41s
Test Suite / compose-smoke (push) Failing after 3s
Test Suite / pytest-backend (push) Has been skipped
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 1m7s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Deploy Development / deploy (push) Successful in 41s
Test Suite / compose-smoke (push) Failing after 3s
Test Suite / pytest-backend (push) Has been skipped
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 1m7s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
1ce20d8bdb
commit
0e5bf72dee
30 files changed
+828
-422
No files matched your search
+28
-87
@@ -1,6 +1,6 @@
|
||||
# Deployment – Kairo Jinkendo
|
||||
|
||||
**Stand:** 2026-07-04
|
||||
**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/`)
|
||||
|
||||
@@ -17,110 +17,59 @@
|
||||
| **PostgreSQL (localhost)** | 5436 | 5437 |
|
||||
| **Domain** | kairo.jinkendo.de | dev.kairo.jinkendo.de |
|
||||
|
||||
**Familien-Referenz (bereits belegt):**
|
||||
|
||||
| App | Prod UI/API | Dev UI/API |
|
||||
|-----|-------------|------------|
|
||||
| Mitai | 3002 / 8002 | 3099 / 8099 |
|
||||
| Shinkan | 3003 / 8003 | 3098 / 8098 |
|
||||
| **Kairo** | **3004 / 8004** | **3097 / 8097** |
|
||||
|
||||
---
|
||||
|
||||
## Einmalige Server-Einrichtung
|
||||
|
||||
Auf dem Pi als User `lars` ausführen:
|
||||
|
||||
```bash
|
||||
# Deploy-Verzeichnisse anlegen
|
||||
mkdir -p /home/lars/docker/kairo
|
||||
mkdir -p /home/lars/docker/kairo-dev
|
||||
mkdir -p /home/lars/docker/kairo /home/lars/docker/kairo-dev
|
||||
|
||||
# Production
|
||||
cd /home/lars/docker/kairo
|
||||
git clone http://192.168.2.144:3000/Lars/Kairo-Jinkendo.git .
|
||||
git checkout main
|
||||
cp .env.example .env
|
||||
# .env bearbeiten (DB_PASSWORD, SMTP, OPENROUTER, …)
|
||||
|
||||
# Development
|
||||
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
|
||||
# .env mit Dev-Werten bearbeiten (siehe Kommentare in .env.example)
|
||||
```
|
||||
# DB_PASSWORD setzen
|
||||
|
||||
> **Hinweis:** Erstes `docker compose up` funktioniert erst, wenn `backend/` und `frontend/` mit Dockerfiles vorhanden sind.
|
||||
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
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Medien (optional, derzeit nicht eingerichtet)
|
||||
## Gitea Actions – Checkliste
|
||||
|
||||
Kairo benötigt **aktuell keine Medien-Speicherung**. Es sind keine Medien-Verzeichnisse auf dem Pi anzulegen.
|
||||
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**
|
||||
|
||||
Falls später Datei-Uploads o. Ä. nötig werden:
|
||||
| Workflow | Trigger |
|
||||
|----------|---------|
|
||||
| `deploy-dev.yml` | Push `develop` |
|
||||
| `deploy-prod.yml` | Push `main` |
|
||||
| `test.yml` | Push/PR (compose-smoke) + nach Deploy (Integration) |
|
||||
|
||||
1. **NAS-Freigabe** auf dem Synology anlegen (nicht auf dem Raspberry Pi speichern).
|
||||
2. **Mount auf dem Pi** einrichten (z. B. `/mnt/nas/kairo-media` bzw. `/mnt/nas/kairo-media/dev`).
|
||||
3. **`docker-compose.override.yml`** im jeweiligen Deploy-Verzeichnis ergänzen (wird von Git ignoriert):
|
||||
|
||||
```yaml
|
||||
services:
|
||||
backend:
|
||||
environment:
|
||||
MEDIA_ROOT: /app/media
|
||||
volumes:
|
||||
- /mnt/nas/kairo-media:/app/media # Dev: …/kairo-media/dev
|
||||
```
|
||||
|
||||
4. Im Backend `MEDIA_ROOT` auswerten — erst wenn die App Medien unterstützt.
|
||||
|
||||
Analog Shinkan (`SHINKAN_MEDIA_HOST`), aber bewusst **nicht** Teil des Initial-Setups.
|
||||
CI auf dem Pi nutzt localhost-Ports. Öffentliche Domains sind für Reverse-Proxy optional.
|
||||
|
||||
---
|
||||
|
||||
## Reverse Proxy (Synology / Fritz!Box)
|
||||
## Medien (optional)
|
||||
|
||||
Analog zu Shinkan — neue Hostnamen im Proxy eintragen:
|
||||
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` |
|
||||
|
||||
SSL/TLS wie bei den Schwester-Apps (Let's Encrypt über Synology).
|
||||
|
||||
---
|
||||
|
||||
## Gitea Actions
|
||||
|
||||
Workflows unter `.gitea/workflows/`:
|
||||
|
||||
| Workflow | Trigger | Aktion |
|
||||
|----------|---------|--------|
|
||||
| `deploy-dev.yml` | Push auf `develop` | Build + Deploy nach `kairo-dev/` |
|
||||
| `deploy-prod.yml` | Push auf `main` | Build + Deploy nach `kairo/` |
|
||||
| `test.yml` | PR/Push `develop`, nach Deploy | pytest, Lint, Frontend-Build, k6, Playwright |
|
||||
|
||||
Health-Checks nach Deploy:
|
||||
|
||||
- Dev: `curl http://localhost:8097/api/health` (Backend direkt); mit Frontend zusätzlich `http://localhost:3097/api/health`
|
||||
- Prod: `curl http://localhost:8004/api/health` (Backend direkt); mit Frontend zusätzlich `http://localhost:3004/api/health`
|
||||
|
||||
---
|
||||
|
||||
## Gitea Secrets (für E2E-Tests)
|
||||
|
||||
In Gitea unter Repository → Settings → Actions → Secrets (analog Shinkan):
|
||||
|
||||
| Secret | Verwendung |
|
||||
|--------|------------|
|
||||
| `E2E_DEV_TEST_EMAIL` | Playwright Dev-Login |
|
||||
| `E2E_DEV_TEST_PASSWORD` | Playwright Dev-Login |
|
||||
| `E2E_PROD_TEST_EMAIL` | Playwright Prod-Login |
|
||||
| `E2E_PROD_TEST_PASSWORD` | Playwright Prod-Login |
|
||||
|
||||
---
|
||||
|
||||
## Manuelles Deploy
|
||||
@@ -139,12 +88,4 @@ docker compose build --no-cache
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Nächster Schritt (App-Code)
|
||||
|
||||
1. `backend/` mit FastAPI-Skeleton (main.py, Dockerfile, migrations/)
|
||||
2. `frontend/` mit React/Vite-Skeleton (Dockerfile, nginx.conf)
|
||||
3. Erster Push auf `develop` → Auto-Deploy Dev
|
||||
4. Reverse-Proxy-Einträge für Domains aktivieren
|
||||
5. Gitea E2E-Secrets setzen
|
||||
Health: `curl http://localhost:8097/api/health` (Dev) bzw. `http://localhost:8004/api/health` (Prod)
|
||||
Reference in new issue
Block a user