local-dev: stop spawned engine containers in down/clean

Backend's runtime spawns the engine container outside the compose
project, so `docker compose down` left a `galaxy-game-…` container
running. Add a `stop-engines` target that finds them by their OCI
image-title label (set in game/Dockerfile) and remove forcibly;
make `down` and `clean` depend on it. `clean` additionally wipes
the per-game state directory under /tmp/galaxy-game-state.

Add a troubleshooting note for the related symptom: when the
browser holds a keypair from a previous DB and `make clean`
recreates everything, the lobby renders "no games yet" until the
user clears site data or opens an incognito window. The dev user
keeps the same email but receives a fresh user_id, which the old
keypair cannot authenticate against.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-08 19:04:05 +02:00
parent 804fdd2a72
commit 82c4f70156
2 changed files with 38 additions and 5 deletions
+13
View File
@@ -181,6 +181,19 @@ make status docker compose ps
## Troubleshooting
- **Lobby shows "no games yet" after `make clean && make up`** —
the browser still holds a keypair + device session bound to the
user_id from the previous DB. The new user has the same email
(`dev@local.test`) but a fresh user_id, so the old keypair
authenticates against a session row that no longer exists or
points at the wrong account. Open the page in an incognito
window, or wipe site data for `localhost:5173` (DevTools →
Application → Storage → Clear site data) and log in again.
- **`make down` leaves a `galaxy-game-…` container behind** — fixed
in this Makefile: `make down` and `make clean` now stop spawned
engine containers via the `org.opencontainers.image.title=
galaxy-game-engine` label. To stop them by hand without touching
the rest of the stack, `make stop-engines`.
- **`make up` reports a build error mentioning `pkg/cronutil`** —
upstream module list drifted; copy any new `pkg/<name>/` line into
the local-dev `backend.Dockerfile` / `gateway.Dockerfile` to match