57 lines
1.7 KiB
Markdown
57 lines
1.7 KiB
Markdown
# C0PY — Plattformsinfrastruktur
|
|
|
|
Det här dokumentet beskriver hur c0py ska sättas upp på SIAX Cloud.
|
|
|
|
## Steg 1: Skapa repo (Gitea)
|
|
|
|
```bash
|
|
# Repot skapas på git.siax.io som sax3l/c0py
|
|
# Pusha sedan lokalt repo
|
|
git push git@100.121.34.99:2222/sax3l/c0py.git main
|
|
```
|
|
|
|
## Steg 2: Coolify app
|
|
|
|
| Inställning | Värde |
|
|
|---|---|
|
|
| Resource type | Application |
|
|
| Git source | `git@100.121.34.99:2222/sax3l/c0py.git` |
|
|
| Build pack | Dockerfile |
|
|
| Domain | `c0py.siax.io` |
|
|
| Port | 3000 |
|
|
| Healthcheck path | `/health` |
|
|
|
|
## Steg 3: Postgres
|
|
|
|
Skapa dedikerad Postgres i Coolify för c0py (ej shared). Databasnamn: `c0py`.
|
|
|
|
## Steg 4: Infisical secrets
|
|
|
|
Projekt: `c0py` (eller nytt under `siax-platform`)
|
|
|
|
| Secret | Värde |
|
|
|---|---|
|
|
| `DATABASE_URL` | Postgres connection string |
|
|
| `CL0UD_BASE_URL` | `https://cl0ud.siax.io` |
|
|
| `ZITADEL_ISSUER` | `https://id-customers.siax.io` |
|
|
| `ZITADEL_AUDIENCE` | `api.c0py.siax.io` |
|
|
| `PORT` | `3000` |
|
|
|
|
## Steg 5: DNS
|
|
|
|
`c0py.siax.io` → A-record → server med Coolify appen (Cloudflare + PowerDNS dual-write).
|
|
|
|
## Steg 6: Zitadel projekt
|
|
|
|
Skapa OIDC-app under projekt `c0py` (eller motsvarande). Client credentials flow för API, PKCE för web.
|
|
|
|
## Steg 7: Deploy verification
|
|
|
|
1. `pnpm install --frozen-lockfile` (eller motsvarande i CI)
|
|
2. `pnpm run typecheck`
|
|
3. `pnpm run test`
|
|
4. `pnpm run build`
|
|
5. Pusha main → CI (`ci.yml`); deploy sker manuellt enligt [`DEPLOY.md`](../DEPLOY.md) (Coolify git-buildpack är trasigt för detta monorepo — bygg `<app-uuid>:latest` på server6 och kör `docker compose up -d` i appkatalogen)
|
|
6. Verifiera `https://c0py-api.siax.io/health` → 200 OK
|
|
7. Verifiera fail-closed: `https://c0py-api.siax.io/v1/c0py/registries` → 401 utan token
|