From fe57a690c01d9ae01f2d9440c1ac8875265d75a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Tue, 14 Apr 2026 12:13:09 +0200 Subject: [PATCH 1/2] Fix Dockerfiles: add jobs package for pg-boss resolution Both Dockerfiles were missing packages/jobs/package.json in the deps stage, causing pnpm install to skip pg-boss. Also copy app/jobs directories into the runtime stage so job handlers are available at runtime. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/journal/Dockerfile | 2 ++ apps/planner/Dockerfile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/journal/Dockerfile b/apps/journal/Dockerfile index 6d47d1b..dc609e4 100644 --- a/apps/journal/Dockerfile +++ b/apps/journal/Dockerfile @@ -14,6 +14,7 @@ COPY packages/i18n/package.json packages/i18n/ COPY packages/api/package.json packages/api/ COPY packages/map-core/package.json packages/map-core/ COPY packages/db/package.json packages/db/ +COPY packages/jobs/package.json packages/jobs/ RUN pnpm install --frozen-lockfile FROM base AS build @@ -32,6 +33,7 @@ COPY --from=deps /app/apps/journal/node_modules ./apps/journal/node_modules COPY --from=build /app/apps/journal/build ./apps/journal/build COPY --from=build /app/apps/journal/server.ts ./apps/journal/server.ts COPY --from=build /app/apps/journal/app/lib ./apps/journal/app/lib +COPY --from=build /app/apps/journal/app/jobs ./apps/journal/app/jobs COPY --from=build /app/apps/journal/package.json ./apps/journal/package.json COPY --from=build /app/packages ./packages diff --git a/apps/planner/Dockerfile b/apps/planner/Dockerfile index 1f6effb..a6f8a9a 100644 --- a/apps/planner/Dockerfile +++ b/apps/planner/Dockerfile @@ -12,6 +12,7 @@ COPY packages/map/package.json packages/map/ COPY packages/gpx/package.json packages/gpx/ COPY packages/i18n/package.json packages/i18n/ COPY packages/db/package.json packages/db/ +COPY packages/jobs/package.json packages/jobs/ RUN pnpm install --frozen-lockfile FROM base AS build @@ -30,6 +31,7 @@ COPY --from=deps /app/apps/planner/node_modules ./apps/planner/node_modules COPY --from=build /app/apps/planner/build ./apps/planner/build COPY --from=build /app/apps/planner/server.ts ./apps/planner/server.ts COPY --from=build /app/apps/planner/app/lib ./apps/planner/app/lib +COPY --from=build /app/apps/planner/app/jobs ./apps/planner/app/jobs COPY --from=build /app/apps/planner/package.json ./apps/planner/package.json COPY --from=build /app/packages ./packages From 7c207a2a983f4d452fb2ed44fdcf9a77273da49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Tue, 14 Apr 2026 12:15:25 +0200 Subject: [PATCH 2/2] Add CI check for missing workspace packages in Dockerfiles Adds a script that verifies every packages/*/package.json is listed in all app Dockerfiles. Catches the recurring issue where adding a new workspace package breaks production because the Dockerfile deps stage doesn't know about it. Also fixes two pre-existing missing packages in the planner Dockerfile (api, map-core) caught by the new check. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yml | 7 +++++++ apps/planner/Dockerfile | 2 ++ scripts/check-dockerfiles.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100755 scripts/check-dockerfiles.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fd619e..3240a80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,13 @@ jobs: run: pnpm audit --audit-level=high continue-on-error: true + dockerfile-check: + name: Dockerfile Package Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - run: bash scripts/check-dockerfiles.sh + typecheck: name: Typecheck runs-on: ubuntu-latest diff --git a/apps/planner/Dockerfile b/apps/planner/Dockerfile index a6f8a9a..52b221d 100644 --- a/apps/planner/Dockerfile +++ b/apps/planner/Dockerfile @@ -11,6 +11,8 @@ COPY packages/ui/package.json packages/ui/ COPY packages/map/package.json packages/map/ COPY packages/gpx/package.json packages/gpx/ COPY packages/i18n/package.json packages/i18n/ +COPY packages/api/package.json packages/api/ +COPY packages/map-core/package.json packages/map-core/ COPY packages/db/package.json packages/db/ COPY packages/jobs/package.json packages/jobs/ RUN pnpm install --frozen-lockfile diff --git a/scripts/check-dockerfiles.sh b/scripts/check-dockerfiles.sh new file mode 100755 index 0000000..6bd6a63 --- /dev/null +++ b/scripts/check-dockerfiles.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# Verify all workspace packages are listed in Dockerfiles. +# Run in CI to catch missing COPY lines when new packages are added. +set -euo pipefail + +errors=0 + +for pkg_json in packages/*/package.json; do + pkg_dir=$(dirname "$pkg_json") # e.g. packages/jobs + pkg_name=$(basename "$pkg_dir") # e.g. jobs + + for dockerfile in apps/*/Dockerfile; do + app=$(basename "$(dirname "$dockerfile")") + if ! grep -q "COPY ${pkg_dir}/package.json" "$dockerfile"; then + echo "ERROR: $dockerfile is missing COPY for $pkg_dir/package.json" + errors=$((errors + 1)) + fi + done +done + +if [ "$errors" -gt 0 ]; then + echo "" + echo "$errors missing package(s) in Dockerfiles. Add COPY lines to the deps stage." + exit 1 +fi + +echo "All workspace packages present in all Dockerfiles."