Skip to content

Commit 578587c

Browse files
authored
fix(docker): include @testplanit/api dist in image build context (#451)
1 parent 7f274b1 commit 578587c

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ docs/.docusaurus
2626
forge-app/dist
2727
cli/dist
2828
packages/*/dist
29+
# Exception: @testplanit/api ships its built dist (committed, not regenerated
30+
# in-image) and the app imports it, so the image build needs it.
31+
!packages/api/dist
2932

3033
# Large local data & prebuilt binaries — never needed in the image.
3134
testplanit/backups

testplanit/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ COPY packages/wdio-testplanit-reporter/package.json ./packages/wdio-testplanit-r
3030
# frozen install reads these, so they must be present before it runs.
3131
COPY patches ./patches/
3232

33-
# Install only the testplanit project's dependencies (it has no workspace deps).
33+
# Install testplanit's dependencies (includes the @testplanit/api workspace pkg).
3434
RUN pnpm install --frozen-lockfile --filter testplanit --ignore-scripts
3535

36-
# App source.
36+
# App source, plus the @testplanit/api workspace package it imports. Its built
37+
# dist is committed (and un-ignored in .dockerignore); without it the workspace
38+
# symlink resolves to an empty dir and `next build` cannot resolve @testplanit/api.
3739
COPY testplanit/ ./testplanit/
40+
COPY packages/api ./packages/api/
3841

3942
WORKDIR /app/testplanit
4043
# Version info: use the pre-generated file if present, else derive it.
@@ -79,6 +82,9 @@ RUN pnpm install --frozen-lockfile --filter testplanit --ignore-scripts
7982
# Produce a self-contained production node_modules for testplanit (no symlinks
8083
# pointing outside the deploy dir), suitable for copying into the final images.
8184
COPY testplanit/ ./testplanit/
85+
# @testplanit/api workspace dependency, so `pnpm deploy` bundles it into the
86+
# self-contained production node_modules.
87+
COPY packages/api ./packages/api/
8288
RUN pnpm --filter=testplanit deploy --prod --legacy --ignore-scripts /app/deploy
8389
# Rebuild native modules in the deployed tree.
8490
RUN cd /app/deploy && npm rebuild bcrypt sharp 2>/dev/null || true

0 commit comments

Comments
 (0)