fix: dockerfile build paths#7322
Conversation
WalkthroughThe Dockerfiles for the admin, space, and web applications were updated to standardize environment variable syntax, capitalize stage names, correct build artifact paths, and add non-root user handling for improved security. Unused copy commands were removed, and clarifying comments were added. No changes were made to application logic or exported entities. Changes
Sequence Diagram(s)sequenceDiagram
participant Dockerfile
participant BaseImage
participant Installer
participant Runner
Dockerfile->>BaseImage: FROM node:... AS base
Dockerfile->>Installer: FROM base AS installer
Installer->>Installer: Set ENV vars (disable telemetry)
Installer->>Installer: Build Next.js app
Dockerfile->>Runner: FROM base AS runner
Runner->>Runner: Create non-root user/group
Runner->>Runner: Set ENV vars (disable telemetry)
Runner->>Runner: Copy build artifacts from installer
Runner->>Runner: Switch to non-root user
Runner->>Runner: Start app
Suggested labels
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (4)
apps/admin/Dockerfile.admin (1)
49-50: Duplicate telemetry flags – declare once per stage
ENV NEXT_TELEMETRY_DISABLED=1andENV TURBO_TELEMETRY_DISABLED=1are declared in both the installer and runner stages. Unless you intentionally want different values, define them once (e.g. inbase) to avoid bloat and drift.apps/web/Dockerfile.web (1)
59-60: Telemetry ENV duplicated – consolidateSame flags appear later in the runner stage; define once to keep layers minimal.
apps/space/Dockerfile.space (2)
49-50: Duplicate telemetry ENV – can be set onceSame optimisation comment as the other Dockerfiles.
89-90: Redundant telemetry ENVSame duplication as above.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/admin/Dockerfile.admin(4 hunks)apps/space/Dockerfile.space(4 hunks)apps/web/Dockerfile.web(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/admin/Dockerfile.admin (1)
65-69: Static files copied to nested path – likely 404 at runtimeNext.js standalone expects
.next/staticat the project root (/app/.next/static). You copy to/app/apps/admin/.next/static, which the runtime server won’t find.-COPY --from=installer /app/apps/admin/.next/static ./apps/admin/.next/static +COPY --from=installer /app/apps/admin/.next/static ./.next/staticPlease verify with a local container run.
apps/web/Dockerfile.web (1)
78-80: Verify static-asset destination
COPY … /app/apps/web/.next/staticmay not be where the standalone server looks for assets. Confirm and adjust to./.next/staticif needed.apps/space/Dockerfile.space (1)
65-69: Potential wrong static pathEnsure the server expects static assets under
.next/static, notapps/space/.next/static.
Description
/appsfolder structureType of Change
Summary by CodeRabbit