Add scripts/build-images.sh: build the two images and publish them

The images docker-compose.yml pulls are normally built by
.gitea/workflows/docker-publish.yml, which needs a registered Actions runner
and a PACKAGES_TOKEN secret. Neither exists on this instance's forge yet, so a
host that pulls rather than builds has nothing to pull — and the two builds are
easy to get wrong by hand: api builds from ./api, web from the repository root,
because the web image compiles frontend/ inside its first stage. A wrong context
produces an image that builds fine and then fails at runtime.

One command now does both and pushes them:

    GITEA_TOKEN=<token with write:package> ./scripts/build-images.sh

TAG, REGISTRY, OWNER, PLATFORM, PUSH and API_TARGET (default vs coach) are all
overridable, and the tags default to exactly what docker-compose.yml asks for.
This commit is contained in:
dsantillan committed 2026-09-21 14:33:30 -04:00
1 parent 87bfd6d4c4
commit affac4a2a0
2 files changed
+102 -1

No files matched your search

+7 -1
View File
@@ -124,7 +124,13 @@ the exercise media (~140 MB) once.
The images are published to this fork's own registry by `.gitea/workflows/docker-publish.yml`:
`git.dploy.lol/dsantillan/kuentagym-api` and `git.dploy.lol/dsantillan/kuentagym-web` (what
`docker-compose.yml` pulls). Prefer building them yourself? Drop the `pull` step and run
`docker compose up -d --build` — you don't need Node or a build step locally either way.
`docker compose up -d --build` — you don't need Node or a build step locally either way. To build
them and publish them to that registry in one go (for a host that pulls rather than builds, and
for a forge whose Actions has no runner registered):
```bash
GITEA_TOKEN=<token with write:package> ./scripts/build-images.sh
```
> Want it reachable from your phone over the internet with passkeys? You'll need an HTTPS
> domain — a two-line change in `.env`. See **[docs/SELF_HOSTING.md](docs/SELF_HOSTING.md)**.