Skip to content

Commit dfb39b4

Browse files
jsell-rhclaude
andauthored
fix(ambient-ui): fix standalone output path in Dockerfile (#1620)
## Summary - Fix `Cannot find module '/app/server.js'` crash at container startup - `outputFileTracingRoot` resolves `../..` to `/` in Docker (WORKDIR `/app`), so standalone output nests under `app/` (`.next/standalone/app/server.js`), not `components/ambient-ui/` - Use correct hardcoded path: `cp -r .next/standalone/app/. /app-output/` ## Verification Tested locally with podman: - `server.js` present at `/app/server.js` - Container starts, Next.js returns 200 ## Test plan - [ ] CI Docker build passes - [ ] Container starts without `MODULE_NOT_FOUND` - [ ] Ambient UI accessible via route 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b5e6290 commit dfb39b4

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

components/ambient-ui/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ 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/
39+
# outputFileTracingRoot is ../.. which resolves to / in Docker (WORKDIR /app),
40+
# so standalone nests files under app/ (i.e. .next/standalone/app/server.js).
4141
RUN mkdir -p /app-output/public /app-output/.next/static && \
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 && \
42+
cp -r .next/standalone/app/. /app-output/ && \
4443
cp -r .next/static/. /app-output/.next/static/ && \
4544
cp -r public/. /app-output/public/ && \
4645
chmod -R g=u /app-output && \

0 commit comments

Comments
 (0)