fix(compose): keep the CMS opt-in so it cannot claim the CI port
CI / check (push) Successful in 36s
CI / tests-imaging-browsers (push) Successful in 1m49s
CI / tests-integration (push) Successful in 1m59s
CI / tests-unit (push) Successful in 2m4s
CI / tests-quality (push) Successful in 42s
CI / tests-ui (push) Successful in 4m39s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 3m20s
CI / check (push) Successful in 36s
CI / tests-imaging-browsers (push) Successful in 1m49s
CI / tests-integration (push) Successful in 1m59s
CI / tests-unit (push) Successful in 2m4s
CI / tests-quality (push) Successful in 42s
CI / tests-ui (push) Successful in 4m39s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 3m20s
On a CI-managed host scripts/ci-deploy.sh owns port 3002 through the blue/green slots, so a compose replica of the cms service could only ever crash-loop on EADDRINUSE — it never serves traffic, because nginx points at a slot container. Gate the service behind the `cms` profile so a bare `docker compose up -d` starts only byparr. Naming the service explicitly (`docker compose up -d cms`, which is what the installer and updater already do) still enables the profile automatically, so the compose-only install path keeps working. Keep the one port that is actually served (3002) and make the 2 GB ceiling hard by capping swap at 2g as well. Drop the green compose service (3003): the green slot only ever exists as a docker run container created by CI, so compose no longer defines it and the two paths cannot drift apart. The loopback override contract stays covered: proxy-config.test.mjs now renders the configuration with --profile cms, and a new build-contract test pins the profile and the memory limits so neither can be dropped by accident.
This commit is contained in:
1 parent
5c428c4526
commit
597287fce5
5 files changed
+52
-22
No files matched your search
@@ -18,7 +18,7 @@ const hasCompose =
|
||||
}).status === 0;
|
||||
|
||||
it.skipIf(!hasCompose)(
|
||||
"loads the loopback profile from .env for bare Compose commands without changing mounts or host networking",
|
||||
"loads the loopback override from .env for the cms service without changing mounts or host networking",
|
||||
() => {
|
||||
const directory = mkdtempSync(path.join(tmpdir(), "cms-proxy-config-"));
|
||||
try {
|
||||
@@ -50,9 +50,12 @@ it.skipIf(!hasCompose)(
|
||||
["CMS_RELEASE", "HOSTNAME", "PORT"].includes(key)
|
||||
)
|
||||
delete environment[key];
|
||||
// `cms` is behind the `cms` profile so a bare `docker compose up -d`
|
||||
// can never squat port 3002 on a CI-managed host. Selecting the
|
||||
// profile here keeps the loopback/port-override contract under test.
|
||||
const result = spawnSync(
|
||||
"docker",
|
||||
["compose", "config", "--format", "json"],
|
||||
["compose", "--profile", "cms", "config", "--format", "json"],
|
||||
{ cwd: directory, env: environment, encoding: "utf8", timeout: 15_000 },
|
||||
);
|
||||
expect(result.status, result.stderr).toBe(0);
|
||||
|
||||
Reference in new issue
Block a user