Browse Source

update readme

gitcitadel
Silberengel 2 weeks ago
parent
commit
fa610dfebc
  1. 26
      README.md

26
README.md

@ -127,33 +127,31 @@ For a full **Nostr backfill** + one-shot prewarm, use **`make prewarm`** (or a h
## Production / Hub (remote server) ## Production / Hub (remote server)
The app runs as a **pre-built** image (no app source on the server). The server only needs `compose.hub.yaml`, a `.env`, and Docker. Default image: `silberengel/unfold:latest`; override with **`UNFOLD_DOCKER_IMAGE`**. The app runs as a **pre-built** image (no app source on the server). The server only needs `compose.hub.yaml`, a `.env`, and Docker. Default image: **`silberengel/unfold:gitcitadel`** (GitCitadel site on the **`gitcitadel`** branch); override with **`UNFOLD_DOCKER_IMAGE`**.
| Topic | Notes | | Topic | Notes |
|-------|--------| |-------|--------|
| `compose.hub.yaml` | Defines **`php`** (FrankenPHP) + **`database`** (MySQL) + **`prewarm`** (same app image: **`app:prewarm` every 10 minutes**, like dev’s `docker/cron`). Optional: disable `prewarm` in Compose if you prefer a host `cron` only. | | `compose.hub.yaml` | Compose project **`gitcitadel`** (containers e.g. `gitcitadel-php-1`). Defines **`php`** (FrankenPHP) + **`database`** (MySQL) + **`prewarm`** (same app image: **`app:prewarm` every 10 minutes**, like dev’s `docker/cron`). Optional: disable `prewarm` in Compose if you prefer a host `cron` only. |
| HTTP | **`HTTP_PUBLISH`** in `.env` maps **host** port → container **80** (default **9080**). Put a reverse proxy (e.g. Apache) in front; set **`TRUSTED_PROXIES`** to match your proxy (often include `127.0.0.0/8` and the Docker bridge CIDR, e.g. `172.16.0.0/12`). | | HTTP | **`HTTP_PUBLISH`** in `.env` maps **host** port → container **80** (default **`127.0.0.1:9085`** for `gitcitadel.imwald.eu`). Put a reverse proxy (e.g. Apache) in front; set **`TRUSTED_PROXIES`** to match your proxy (often include `127.0.0.0/8` and the Docker bridge CIDR, e.g. `172.16.0.0/12`). |
| Secrets | Real **`APP_SECRET`** and **`MYSQL_*`** (or external DB via `DATABASE_URL` if you change the file). Do not commit production `.env`. | | Secrets | Real **`APP_SECRET`** and **`MYSQL_*`** (or external DB via `DATABASE_URL` if you change the file). Do not commit production `.env`. |
| `PREWARM_FLAGS` | Optional extra CLI args for the hub **`prewarm`** service (and dev **`cron`**). After editing `.env`, run `docker compose -f compose.hub.yaml up -d --force-recreate prewarm`. | | `PREWARM_FLAGS` | Optional extra CLI args for the hub **`prewarm`** service (and dev **`cron`**). After editing `.env`, run `docker compose -f compose.hub.yaml up -d --force-recreate prewarm`. |
### Build, tag, and push (on your machine or CI) ### Build, tag, and push (on your machine or CI)
From the **repository root** (same `Dockerfile` as local prod): From the **repository root** on the **`gitcitadel`** branch (same `Dockerfile` as local prod):
```bash ```bash
# Production image # GitCitadel hub image (default in compose.hub.yaml)
docker build --platform linux/amd64 --target frankenphp_prod -t YOUR_REGISTRY/unfold:latest . docker build --platform linux/amd64 --target frankenphp_prod -t silberengel/unfold:gitcitadel .
docker push silberengel/unfold:gitcitadel
# Optional: immutable tag for rollbacks # Optional: immutable tag for rollbacks (set UNFOLD_DOCKER_IMAGE on the server to match)
docker build --platform linux/amd64 --target frankenphp_prod -t YOUR_REGISTRY/unfold:1.0.0 . docker build --platform linux/amd64 --target frankenphp_prod -t silberengel/unfold:1.0.0 .
docker push silberengel/unfold:1.0.0
# Push what you use on the server
docker push YOUR_REGISTRY/unfold:latest
docker push YOUR_REGISTRY/unfold:1.0.0
``` ```
- Use **`linux/amd64`** if the server is amd64; use **`arm64`** (or a matching `--platform`) for arm servers. - Use **`linux/amd64`** if the server is amd64; use **`arm64`** (or a matching `--platform`) for arm servers.
- The image name must match what the server will pull: either keep **`UNFOLD_DOCKER_IMAGE=YOUR_REGISTRY/unfold:TAG`** in server `.env`, or push to the default name **`silberengel/unfold:latest`**. - The image tag must match what the server pulls: push to **`silberengel/unfold:gitcitadel`**, or set **`UNFOLD_DOCKER_IMAGE=YOUR_REGISTRY/unfold:TAG`** in server `.env`.
### Deploy on the server (pull, up, migrate) ### Deploy on the server (pull, up, migrate)
@ -185,7 +183,7 @@ make -f Makefile.hub backfill # up + migrate + articles-get + prewarm-onc
**Optional image / tag** (in `.env` or one-shot): **Optional image / tag** (in `.env` or one-shot):
```bash ```bash
export UNFOLD_DOCKER_IMAGE=YOUR_REGISTRY/unfold:1.0.0 export UNFOLD_DOCKER_IMAGE=silberengel/unfold:1.0.0
docker compose -f compose.hub.yaml up -d docker compose -f compose.hub.yaml up -d
``` ```

Loading…
Cancel
Save