From 4e4843ce1a063edcbe62f98a67c8c2c948e6d9d3 Mon Sep 17 00:00:00 2001 From: Offending Commit Date: Tue, 2 Jun 2026 13:59:04 -0500 Subject: [PATCH] refactor(make): rename compose targets to up/prod/down/clean Concise verbs: make up (dev build+run), make prod (pull published image), make down (stop regardless of mode), make clean (down + drop local image). Updates all docs and compose-file comment headers to match. --- AGENTS.md | 7 ++++--- Makefile | 11 +++++++---- README.md | 11 ++++++----- docker-compose.prod.yml | 2 +- docker-compose.yml | 9 +++++---- docs/docker.md | 11 ++++++----- 6 files changed, 29 insertions(+), 22 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 63e839b..3a4d8cb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -17,9 +17,10 @@ Frontend UI for self-hosted Honcho instances — browse memories, peers, session | `make test` | Vitest (unit + integration), excludes `e2e/` | | `make test-e2e` | Playwright e2e (uncached) | | `make smoke-docker` | Local: build image + hermetic smoke test of the `/api` proxy (Docker required) | -| `make compose-up` | Run the web container from source (dev-forward, builds) at :8080 | -| `make compose-up-prod` | Run the web container from the published image (pulls `ghcr…:latest`) | -| `make compose-down` | Stop + remove the web container | +| `make up` | Run the web container from source (dev-forward, builds) at :8080 | +| `make prod` | Run the web container from the published image (pulls `ghcr…:latest`) | +| `make down` | Stop + remove the web container (dev or prod) | +| `make clean` | `down` + remove the locally built image | | `make check` | lint + typecheck + test | | `pnpm --filter @openconcho/desktop cargo-check` | Local Rust/Tauri compile check before pushing desktop changes | | `pnpm --filter @openconcho/web generate:api` | Regen `src/api/schema.d.ts` from `openapi.json` | diff --git a/Makefile b/Makefile index 0f171d2..7b62b9c 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ .PHONY: bootstrap dev dev-web dev-desktop \ build test test-e2e lint lint-fix typecheck check \ ci-web ci-desktop smoke-docker \ - compose-up compose-up-prod compose-down install help + up prod down clean install help help: @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS=":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}' @@ -51,14 +51,17 @@ ci-desktop: ## CI: cargo-check for @openconcho/desktop smoke-docker: ## Local: build the image + smoke-test the /api proxy (Docker required) bash docker/smoke-test.sh -compose-up: ## Run the web container from source (builds; dev-forward) at :8080 +up: ## Run the web container from source (dev-forward, builds) at :8080 docker compose up -d --build -compose-up-prod: ## Run the web container from the published image (pulls latest) +prod: ## Run the web container from the published image (pulls ghcr latest) docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d -compose-down: ## Stop and remove the web container +down: ## Stop + remove the web container (works for dev or prod) docker compose down --remove-orphans +clean: down ## down + remove the locally built image + -docker image rm openconcho-web:local + install: ## pnpm install (no playwright) pnpm install diff --git a/README.md b/README.md index baaef8d..c06d81a 100644 --- a/README.md +++ b/README.md @@ -97,17 +97,18 @@ Two Compose modes (the published image is `ghcr.io/offendingcommit/openconcho-we ```bash # Dev-forward — build from this repo and run your local changes: -OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make compose-up +OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make up # Production — pull the latest published image instead of building: -OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make compose-up-prod +OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make prod -make compose-down # stop + remove +make down # stop + remove (dev or prod) +make clean # down + drop the locally built image # → http://localhost:8080 ``` -`make compose-up` uses [`docker-compose.yml`](docker-compose.yml) (`build: .`); -`make compose-up-prod` layers [`docker-compose.prod.yml`](docker-compose.prod.yml) +`make up` uses [`docker-compose.yml`](docker-compose.yml) (`build: .`); +`make prod` layers [`docker-compose.prod.yml`](docker-compose.prod.yml) to pull `ghcr…:latest`. `OPENCONCHO_DEFAULT_HONCHO_URL` seeds the first instance (absolute URL); `OPENCONCHO_UPSTREAM_ALLOWLIST` is an optional SSRF guard (comma-separated host globs) for when you expose the proxy. Full details and env diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index bb3dd75..4ddd153 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -2,7 +2,7 @@ # Layer it on top of docker-compose.yml; it reuses every setting there (env, ports, # extra_hosts) and only swaps the local build for the latest published image. # -# make compose-up-prod +# make prod # docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d services: openconcho: diff --git a/docker-compose.yml b/docker-compose.yml index fb689cb..786c38e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,15 @@ # OpenConcho web UI — DEV-FORWARD compose (builds from THIS repo). # -# make compose-up # build from source + run → http://localhost:8080 -# make compose-up-prod # pull the published image instead (see docker-compose.prod.yml) -# make compose-down # stop + remove +# make up # build from source + run → http://localhost:8080 +# make prod # pull the published image instead (see docker-compose.prod.yml) +# make down # stop + remove (dev or prod) +# make clean # down + drop the locally built image # # The SPA issues all Honcho calls same-origin to /api; nginx forwards each to the # URL named in the per-request X-Honcho-Upstream header (no browser CORS). Seed the # first instance with OPENCONCHO_DEFAULT_HONCHO_URL: # -# OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make compose-up +# OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make up # # To fold into an existing Honcho Compose stack, set OPENCONCHO_DEFAULT_HONCHO_URL # to the api service (e.g. http://api:8000 — nginx resolves it on the compose diff --git a/docs/docker.md b/docs/docker.md index 4cca817..9f8f245 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -24,17 +24,18 @@ Two Compose files, env/ports defined once in the base: image** (`ghcr.io/offendingcommit/openconcho-web:latest`, `pull_policy: always`). ```bash -make compose-up # build from source + run → http://localhost:8080 -make compose-up-prod # pull ghcr…:latest instead of building -make compose-down # stop + remove +make up # build from source + run → http://localhost:8080 +make prod # pull ghcr…:latest instead of building +make down # stop + remove (dev or prod) +make clean # down + drop the locally built image ``` -`make compose-up-prod` expands to +`make prod` expands to `docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d`. Set env inline or via a `.env` file: ```bash -OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make compose-up-prod +OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make prod ``` The published image is multi-arch (amd64 + arm64); the first publish creates a