@getmonoceros/workbench 1.33.4 → 1.33.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -1936,6 +1936,12 @@ async function ensureProxy(opts = {}) {
1936
1936
  PROXY_CONTAINER_NAME
1937
1937
  ]);
1938
1938
  if (state.exitCode === 0) {
1939
+ await docker([
1940
+ "update",
1941
+ "--restart",
1942
+ PROXY_RESTART_POLICY,
1943
+ PROXY_CONTAINER_NAME
1944
+ ]);
1939
1945
  if (state.stdout.trim() === "true") return;
1940
1946
  const start = await docker(["start", PROXY_CONTAINER_NAME]);
1941
1947
  if (start.exitCode !== 0) {
@@ -1951,6 +1957,11 @@ async function ensureProxy(opts = {}) {
1951
1957
  "-d",
1952
1958
  "--name",
1953
1959
  PROXY_CONTAINER_NAME,
1960
+ // Survive a Docker Desktop / host restart on its own (see the heal-in-
1961
+ // place note above). `maybeStopProxy` still removes it when the last
1962
+ // port-container goes away, so it never lingers without a consumer.
1963
+ "--restart",
1964
+ PROXY_RESTART_POLICY,
1954
1965
  "--network",
1955
1966
  PROXY_NETWORK_NAME,
1956
1967
  "-p",
@@ -2003,7 +2014,7 @@ async function maybeStopProxy(opts = {}) {
2003
2014
  `Stopped ${PROXY_CONTAINER_NAME} (no dev-containers with ports left).`
2004
2015
  );
2005
2016
  }
2006
- var PROXY_CONTAINER_NAME, PROXY_NETWORK_NAME, TRAEFIK_IMAGE, defaultDockerExec, realDocker;
2017
+ var PROXY_CONTAINER_NAME, PROXY_NETWORK_NAME, TRAEFIK_IMAGE, PROXY_RESTART_POLICY, defaultDockerExec, realDocker;
2007
2018
  var init_proxy = __esm({
2008
2019
  "src/proxy/index.ts"() {
2009
2020
  "use strict";
@@ -2011,6 +2022,7 @@ var init_proxy = __esm({
2011
2022
  PROXY_CONTAINER_NAME = "monoceros-proxy";
2012
2023
  PROXY_NETWORK_NAME = "monoceros-proxy";
2013
2024
  TRAEFIK_IMAGE = "traefik:v3.3";
2025
+ PROXY_RESTART_POLICY = "unless-stopped";
2014
2026
  defaultDockerExec = (args) => {
2015
2027
  return new Promise((resolve, reject) => {
2016
2028
  const child = spawn3("docker", args, {
@@ -2319,8 +2331,14 @@ function expandCuratedService(name) {
2319
2331
  // Bake the connection-env templates into the yml (suffix → template) so
2320
2332
  // they travel with the service: a renamed/duplicated instance keeps them,
2321
2333
  // and `serviceConnectionEnv` prefixes by the instance's current name.
2322
- ...def.connectionEnv ? { connectionEnv: { ...def.connectionEnv } } : {},
2323
- restart: "unless-stopped"
2334
+ ...def.connectionEnv ? { connectionEnv: { ...def.connectionEnv } } : {}
2335
+ // No `restart:` default on purpose (issue #19). The workspace container
2336
+ // carries no restart policy, so on a Docker/host restart it stays down
2337
+ // until `monoceros start`; defaulting services to `unless-stopped` made
2338
+ // them auto-start ALONE, without the workbench they belong to. Leaving it
2339
+ // off keeps the whole compose group's restart behavior uniform - nothing
2340
+ // comes back on its own. `restart` stays a per-service opt-in in the yml
2341
+ // (schema.ts) for builders who deliberately want a policy.
2324
2342
  };
2325
2343
  }
2326
2344
  function curatedServiceEnvDefaults(name) {
@@ -2493,7 +2511,8 @@ function renderCustomService(name, image) {
2493
2511
  " - rel/host/path:/in/container:ro",
2494
2512
  " healthcheck:",
2495
2513
  " test: curl -f http://localhost:8080/health",
2496
- " restart: unless-stopped"
2514
+ " restart: unless-stopped # optional; off by default so the whole",
2515
+ " # group stays down after a Docker restart"
2497
2516
  ].join("\n");
2498
2517
  return { bodyLines, comment };
2499
2518
  }
@@ -8638,7 +8657,7 @@ var CLI_VERSION;
8638
8657
  var init_version = __esm({
8639
8658
  "src/version.ts"() {
8640
8659
  "use strict";
8641
- CLI_VERSION = true ? "1.33.4" : "dev";
8660
+ CLI_VERSION = true ? "1.33.6" : "dev";
8642
8661
  }
8643
8662
  });
8644
8663