fix(infra): exclude serve-static from 'dev.sh up all' (port collision with apps) #261

Merged
julien merged 1 commits from fix/dev-sh-up-all-include-apps into main 2026-06-01 13:07:09 +02:00
2 changed files with 35 additions and 18 deletions
+2 -2
View File
@@ -187,9 +187,9 @@ $EDITOR infra/local/.env
Run `./infra/local/dev.sh help` for the full reference. Cheat-sheet: Run `./infra/local/dev.sh help` for the full reference. Cheat-sheet:
| Command | Effect | | Command | Effect |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------ | | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `./infra/local/dev.sh up` | Core only (postgres + redis + otel-collector) | | `./infra/local/dev.sh up` | Core only (postgres + redis + otel-collector) |
| `./infra/local/dev.sh up all` | Core + every profile | | `./infra/local/dev.sh up all` | Core + dbtools + observability + apps (full dev stack). serve-static is excluded — it would collide with apps on port 4200 |
| `./infra/local/dev.sh up dbtools` | Core + pgweb | | `./infra/local/dev.sh up dbtools` | Core + pgweb |
| `./infra/local/dev.sh up observability` | Core + Jaeger | | `./infra/local/dev.sh up observability` | Core + Jaeger |
| `./infra/local/dev.sh up serve-static` | Core + Caddy serving `dist/.../browser/` per ADR-0019 | | `./infra/local/dev.sh up serve-static` | Core + Caddy serving `dist/.../browser/` per ADR-0019 |
+21 -4
View File
@@ -14,10 +14,23 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
COMPOSE_FILE="${SCRIPT_DIR}/dev.compose.yml" COMPOSE_FILE="${SCRIPT_DIR}/dev.compose.yml"
# Profiles defined in dev.compose.yml. Keep in sync if a new profile # Every profile defined in dev.compose.yml, used as the teardown /
# is added. # status / logs scope so a profile started under a custom flag is
# always reachable later. Keep in sync if a new profile is added.
ALL_PROFILES=(dbtools observability serve-static apps) ALL_PROFILES=(dbtools observability serve-static apps)
# What `up all` expands to — everything you want running for a full
# dev session. `serve-static` is deliberately excluded:
# - it would collide with `apps` on host port 4200 (both publish the
# SPA there by default — Caddy serves the production build, the
# `apps` profile runs the Angular dev-server);
# - without a prior `nx build --configuration=production`, Caddy
# just 404s every request, so it adds nothing to a comprehensive
# `up all` invocation. Users who actually need it run
# `./infra/local/dev.sh up serve-static` (and `down` still tears
# it down because it's in ALL_PROFILES above).
UP_ALL_PROFILES=(dbtools observability apps)
# Build "--profile p1 --profile p2 …" as separate arguments. # Build "--profile p1 --profile p2 …" as separate arguments.
build_all_profile_flags() { build_all_profile_flags() {
local p local p
@@ -56,7 +69,11 @@ Commands:
up [target...] Bring up the stack. up [target...] Bring up the stack.
Targets: Targets:
(none) core only (postgres + redis + otel-collector) (none) core only (postgres + redis + otel-collector)
all core + all profiles all core + dbtools + observability + apps —
the full dev stack. serve-static is
EXCLUDED because it collides with apps
on port 4200; run it explicitly when
you actually want to serve a prod build.
dbtools core + pgweb dbtools core + pgweb
observability core + jaeger observability core + jaeger
serve-static core + caddy (production-build reverse proxy) serve-static core + caddy (production-build reverse proxy)
@@ -119,7 +136,7 @@ case "$cmd" in
if [[ $# -eq 0 ]]; then if [[ $# -eq 0 ]]; then
dc_core up -d dc_core up -d
elif [[ "$1" == "all" ]]; then elif [[ "$1" == "all" ]]; then
dc_all up -d up_with_profiles "${UP_ALL_PROFILES[@]}"
else else
up_with_profiles "$@" up_with_profiles "$@"
fi fi