Skip to content

fix(docker): repo-root-relative COPY paths for shared build context - #16

Merged
jangid merged 3 commits into
mainfrom
fix/dockerfile-repo-root-context
Jul 4, 2026
Merged

fix(docker): repo-root-relative COPY paths for shared build context#16
jangid merged 3 commits into
mainfrom
fix/dockerfile-repo-root-context

Conversation

@jangid

@jangid jangid commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The alphafi metarepo shared Docker build workflow (shared-docker-build.yml) builds every non-frontend service with repo-root build context (context: .). The current Dockerfile uses bot-directory-relative COPY paths, which do not resolve under that context. This changes the two COPY sources to repo-root-relative paths:

-COPY package*.json ./
+COPY alphafi-betterstack/package*.json ./
-COPY bot.ts ./
+COPY alphafi-betterstack/bot.ts ./

Everything else is unchanged: single-stage node:22-alpine, LABELs, WORKDIR /app, npm ci --production, kill -0 1 HEALTHCHECK, USER node, tsx bot.ts CMD. tsconfig.json is intentionally not copied (tsx needs none; typescript absent under npm ci --production).

Verification

Built from the metarepo root under repo-root context:

  • docker build -f alphafi-betterstack/Dockerfile . succeeds (no missing-file COPY error)
  • --target prod fails with target stage "prod" could not be found (single-stage preserved)
  • /app contains only bot.ts, node_modules, package-lock.json, package.json (no stray metarepo files)

Part of the betterstack-deploy pipeline cycle (metarepo feat/betterstack-deploy-pipeline). This fix must merge and the metarepo submodule pointer bump before the first real shared-workflow build.

jangid added 3 commits July 4, 2026 22:06
The shared metarepo build workflow builds with repo-root context
(context: .), so the bot-dir-relative COPY paths no longer resolve.
Copy package*.json and bot.ts by their repo-root-relative paths.
Single-stage image and all other directives unchanged; tsconfig
intentionally not copied (tsx needs none, tsc absent under
npm ci --production).
@jangid
jangid merged commit f41f896 into main Jul 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant