Skip to content

Commit b5e6290

Browse files
jsell-rhclaude
andauthored
fix(ambient-ui): fix Docker build for standalone output (#1619)
## Summary - Build SDK `dist/` in Docker (ts-sdk `dist/` is gitignored, CI has no pre-built output) - Copy standalone output from correct nested path (`outputFileTracingRoot` nests files under `components/ambient-ui/`) - Use webpack for production build (Turbopack can't resolve `file:` linked dependencies) Fixes the `Cannot find module '/app/server.js'` crash at container startup and the `Module not found: Can't resolve 'ambient-sdk'` build failure. ## Test plan - [x] `npm run build` passes locally with webpack - [x] `server.js` confirmed at `.next/standalone/components/ambient-ui/server.js` - [x] 167 tests pass - [ ] CI Docker build passes and pushes to quay.io - [ ] Container starts without `MODULE_NOT_FOUND` error 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5402772 commit b5e6290

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

components/ambient-ui/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ RUN npm run build
3636

3737
# Prepare standalone output with OpenShift-compatible permissions in the builder
3838
# (the hardened runner image is distroless — no shell or chmod available)
39+
# outputFileTracingRoot is set to ../.. (monorepo root), so standalone output
40+
# nests files under components/ambient-ui/ within .next/standalone/
3941
RUN mkdir -p /app-output/public /app-output/.next/static && \
40-
cp -r .next/standalone/. /app-output/ && \
42+
cp -r .next/standalone/components/ambient-ui/. /app-output/ && \
43+
cp -r .next/standalone/node_modules /app-output/node_modules 2>/dev/null || true && \
4144
cp -r .next/static/. /app-output/.next/static/ && \
4245
cp -r public/. /app-output/public/ && \
4346
chmod -R g=u /app-output && \

0 commit comments

Comments
 (0)