Skip to content

fix(init,check): unique Compose project per scaffold, and report taken stack ports - #368

Merged
Bccorb merged 2 commits into
mainfrom
fix/quickstart-compose-blockers
Nov 10, 2026
Merged

Bccorb merged 2 commits into
mainfrom
fix/quickstart-compose-blockers

Conversation

@Bccorb

@Bccorb Bccorb commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Fixes the two blockers from running the self-hosted quickstart against v0.23.0 (fells-code/seamless-auth-api#561).

#365: a reused project name runs the old project's images

The generated compose file had no project name, so two scaffolds in directories with the same name (everyone who follows the quickstart twice has two my-app projects) were one Compose project. docker compose up reused the first one's my-app-api image, which crashed against the v0.23 starter with does not provide an export named 'requirePermission', and the second project would also have reused the first one's database volume.

  • init writes name: <directory>-<6 hex> and keeps a name an earlier run wrote, the same way seamless add already names its stack. The directory slug moved to src/core/composeName.ts and add uses it too.
  • The fixed container_names are gone, so two projects run side by side. The three CI scripts that refused to start beside a container named seamless-db or api no longer need that guard.
  • check lists running services with docker compose ps in the project, rather than matching "api" in every container name on the machine.

#366: another program on port 5173 goes unnoticed

The stack publishes on 127.0.0.1 only. A Vite dev server on its default [::1]:5173 wins http://localhost:5173 in the browser, and check passed every line.

  • init ends with a warning for each stack port another program holds, on either loopback, saying what breaks and how to find the program with lsof.
  • check fails on a stack port held on [::1] (its own containers hold 127.0.0.1, so only [::1] can show a stranger).
  • check now suggests Docker may be stopped when compose ps fails, since docker --version passes without a daemon.

Not in this PR: an option to move the web app to another port. Today that means editing four values in three files, and it stays open on #366.

Verified

  • npm run build, npm test (2122 passed) and npm run coverage pass.
  • Built CLI, on a machine that still has a stale my-app-api image from 2026-10-24 and a Vite server on [::1]:5173:
    • Two init my-app runs in different folders wrote name: my-app-c6e4eb and name: my-app-e35003, with no container_name.
    • init printed the warning for port 5173 (web) on [::1].
    • docker compose up -d --wait built fresh my-app-c6e4eb-* images, every service went healthy, and the API logged API running with no SyntaxError.
    • check --strict passed the container and health checks and failed only on the [::1]:5173 conflict, exit 1.

Closes #365
Part of #366

A second project scaffolded under a directory name used before shared the
first one's Compose project, so docker compose up ran its old images and
reused its database. The compose file now names the project after the
directory plus a random suffix, keeps a name an earlier run wrote, and pins
no container names.

Closes #365
The stack publishes on 127.0.0.1 only, so a program on [::1]:5173 took
http://localhost:5173 in the browser while every check passed. init now
warns about each taken port, and check fails on one held on [::1]. check
also lists running services from the project's compose file instead of
matching container names across the machine.

Part of #366
@Bccorb Bccorb added this to the v0.24 milestone Nov 10, 2026
@Bccorb
Bccorb merged commit 3525c5d into main Nov 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(init): docker compose up reuses a stale image from an earlier project of the same name, API crashes on requirePermission

1 participant