docs: production deployment facts, DNS/TLS pattern, Coolify gotchas
This commit is contained in:
@@ -15,13 +15,16 @@
|
||||
|
||||
## Drift (Coolify)
|
||||
|
||||
- **App UUID**: `wvmn6eg40jofssvm3nigmav6`, server6
|
||||
- **App UUID API**: `wvmn6eg40jofssvm3nigmav6`, server6 — `c0py-api.siax.io`
|
||||
- **App UUID Web**: `58pa82h4qlzcwsc4shreuwk0`, server6 — `c0py-web.siax.io` (`Dockerfile.web`)
|
||||
- **Postgres UUID**: `qhucpjjpv3mx9jupqkbyf5uh`, server6
|
||||
- **Image**: `wvmn6eg40jofssvm3nigmav6:latest` (built on server6 from /tmp/c0py-build)
|
||||
- **Deploy**: `cd /data/coolify/applications/wvmn6eg40jofssvm3nigmav6 && docker compose up -d`
|
||||
- **DNS**: `c0py.siax.io` → 65.109.19.146 (Cloudflare A, proxied)
|
||||
- **Images**: `<app-uuid>:latest` (built on server6 from /tmp/c0py-build)
|
||||
- **Deploy**: `docker build -t <app-uuid>:latest . && cd /data/coolify/applications/<app-uuid> && docker compose up -d`
|
||||
- **DNS**: `c0py-api` + `c0py-web` → 65.109.19.146 (Cloudflare A, **DNS-only** — proxied ger TLS-fail på tredjenivå)
|
||||
- **Coolify API**: POST `/api/v1/applications/dockerfile` (NOT `/api/v1/applications`)
|
||||
- **Health check**: `GET /health` → 200 (wget-based, Fastify HTTP)
|
||||
- **⚠️ `c0py.siax.io` apex är Worker-kapad** ("Hello World!") — ej åtgärdbar utan Workers-perms
|
||||
- **Coolify dockerfile+git-buildpack**: trasig för detta monorepo (build-context saknar repo-träd) — bygg manuellt
|
||||
|
||||
## Kontrakt
|
||||
|
||||
@@ -38,3 +41,4 @@
|
||||
- `tsx` är devDependency i `@siax/c0py-api` — pnpm länkar workspace-devDeps INTE till rot-nivå
|
||||
- Auth: preHandler hook kollar `Authorization: Bearer *`-header, returnerar 401 annars
|
||||
- **GitHub push**: använd `gh auth login` (keyring), INTE inbäddade tokens i URLs
|
||||
- **Coolify compose på disk kan vara stale** — labels/port regenereras ej vid misslyckad deploy; sed:a compose-filen + `docker compose up -d`, och `docker rm -f` gammal container (den lever kvar vid recreate)
|
||||
|
||||
@@ -5,15 +5,34 @@
|
||||
- **Config**: [`siax.config.json`](siax.config.json)
|
||||
- **CI/CD**: `.gitea/workflows/ci.yml` — körs vid push/PR till main (Gitea Actions, git.siax.io)
|
||||
- **Runtime**: Node 22, port 3000
|
||||
- **Domain**: `c0py.siax.io`
|
||||
- **Domain**: `c0py-web.siax.io` (web) / `c0py-api.siax.io` (API)
|
||||
|
||||
## Produktion (live 2026-09-16)
|
||||
|
||||
| Komponent | Coolify app-uuid | Server | Domän | Image |
|
||||
|---|---|---|---|---|
|
||||
| API (Fastify) | `wvmn6eg40jofssvm3nigmav6` | server6 | `c0py-api.siax.io` | `wvmn6eg40jofssvm3nigmav6:latest` |
|
||||
| Web (Next.js) | `58pa82h4qlzcwsc4shreuwk0` | server6 | `c0py-web.siax.io` | `58pa82h4qlzcwsc4shreuwk0:latest` |
|
||||
| Postgres | `qhucpjjpv3mx9jupqkbyf5uh` | server6 | — (internt) | — |
|
||||
|
||||
- **Deploy-mönster**: Coolify-appar finns som registry-poster, men bygge sker manuellt på
|
||||
server6 (`/tmp/c0py-build && docker build -t <app-uuid>:latest .`) följt av
|
||||
`cd /data/coolify/applications/<app-uuid> && docker compose up -d` — Coolifys
|
||||
dockerfile+git-buildpack sätter build-context till helper-container utan repo-trädet
|
||||
och failar för detta monorepo (`"/apps": not found`).
|
||||
- **DNS**: `c0py-api` + `c0py-web` = Cloudflare A → 65.109.19.146, **DNS-only** (proxied=false).
|
||||
Edge-certet täcker bara `*.siax.io` — tredjenivå-hostnames (`api.c0py.siax.io`) ger
|
||||
TLS-handshake-failure via proxied; DNS-only låter Traefik LE-certifiera direkt (samma
|
||||
mönster som api.act0.siax.io).
|
||||
- **⚠️ c0py.siax.io (apex) är kapad av en Cloudflare Worker/Pages** ("Hello World!",
|
||||
text/plain) utanför vårt token-scope — kan ej avlägsnas utan Workers-perms (Simon-gate).
|
||||
|
||||
## Deploy via Coolify
|
||||
|
||||
- **Coolify dashboard**: `cloud.siax.io`
|
||||
- **Resource type**: Application (git source)
|
||||
- **Git URL**: `git@github.com:sax3l/c0py.git`
|
||||
- **Build pack**: Dockerfile
|
||||
- **Domain**: `c0py.siax.io`
|
||||
- **Resource type**: Application (dockerfile build pack, git source git.siax.io/sax3l/c0py)
|
||||
- **Build pack**: Dockerfile — API: `/Dockerfile`, Web: `/Dockerfile.web`
|
||||
- **ports_exposes**: `3000` (KRITISKT — default 80 ger Trasfik-labels mot fel port)
|
||||
|
||||
## Docker
|
||||
|
||||
@@ -25,7 +44,7 @@ docker run -d -p 3000:3000 \
|
||||
-e DATABASE_URL=postgresql://... \
|
||||
-e CL0UD_BASE_URL=https://cl0ud.siax.io \
|
||||
-e ZITADEL_ISSUER=https://id-customers.siax.io \
|
||||
-e ZITADEL_AUDIENCE=api.c0py.siax.io \
|
||||
-e ZITADEL_AUDIENCE=c0py-api.siax.io \
|
||||
-e AUD0_BASE_URL=https://aud0.siax.io \
|
||||
-e AUD0_API_KEY=... \
|
||||
-e ST0RE_BASE_URL=https://st0re.siax.io \
|
||||
|
||||
Reference in New Issue
Block a user