Skip to content

Conversation

@joornby-angel
Copy link

@joornby-angel joornby-angel commented Sep 26, 2025

Summary by CodeRabbit

  • Chores

    • Standardized container platform settings across services for more consistent multi-architecture builds.
    • Minor formatting cleanups (e.g., ensured newline at end of files).
  • Refactor

    • Control Plane now defaults to production mode, exposes port 3001, and runs with an explicit startup command for more predictable runtime behavior.

Checklist

@coderabbitai
Copy link

coderabbitai bot commented Sep 26, 2025

Walkthrough

Multiple Dockerfiles were changed to use --platform=${TARGETPLATFORM} instead of --platform=${BUILDPLATFORM} in FROM lines. The controlplane Dockerfile also added runtime settings (ENV NODE_ENV=production), copied runtime artifacts (including dbmate), set CMD, and EXPOSE 3001. Minor EOF newline fixes applied.

Changes

Cohort / File(s) Change summary
Platform flag swap (node services)
admission-server/Dockerfile, cdn-server/Dockerfile, studio/Dockerfile
Updated final-stage FROM lines to use --platform=${TARGETPLATFORM} instead of --platform=${BUILDPLATFORM}; studio also had an EOF newline added.
Platform flag swap (distroless / misc)
graphqlmetrics/Dockerfile, router/Dockerfile, keycloak/Dockerfile
Replaced --platform=${BUILDPLATFORM} with --platform=${TARGETPLATFORM} on FROM lines; keycloak also had an EOF newline fixed.
Platform flag swap (Go builder image)
otelcollector/Dockerfile
Switched FROM to --platform=${TARGETPLATFORM} for the golang base; other steps unchanged.
Platform flag swap + runtime additions
controlplane/Dockerfile
Switched final FROM to --platform=${TARGETPLATFORM}; added ENV NODE_ENV=production, restored COPY --from=builder /app/pruned ., copied /usr/local/bin/dbmate from builder, added CMD ["node","dist","index.js"], and EXPOSE 3001.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the primary change of removing build-time platform flags from the Dockerfiles and aligns with the modifications in the changeset by highlighting the infrastructure update; it is concise, clear, and focused on the main change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6dd69c8 and b5ef11a.

📒 Files selected for processing (8)
  • admission-server/Dockerfile (1 hunks)
  • cdn-server/Dockerfile (1 hunks)
  • controlplane/Dockerfile (1 hunks)
  • graphqlmetrics/Dockerfile (1 hunks)
  • keycloak/Dockerfile (2 hunks)
  • otelcollector/Dockerfile (1 hunks)
  • router/Dockerfile (2 hunks)
  • studio/Dockerfile (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • graphqlmetrics/Dockerfile
  • controlplane/Dockerfile

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@joornby-angel joornby-angel changed the title fix(infra): ensure base images use target platform chore(infra): remove --platform build flags from Dockerfiles Sep 29, 2025
Copy link
Member

@endigma endigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @joornby-angel, thanks for the PR! Good catch with the final images being set to BUILDPLATFORM, we can confirm internally that this is an issue. This PR also unsets the option on the builder stages, which is incorrect. If you can fix this up and rebase/merge in main that'd be great, feel free to re-request my review when that's done.

@@ -1,4 +1,4 @@
FROM --platform=${BUILDPLATFORM} node:lts AS builder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option should be set for builders, it's what allows the cross compilation to be fast.

Copy link
Author

@joornby-angel joornby-angel Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a little more reading. I'll modify the final host image platform to make sure the runtime looks right. While I do that, do you know:

  1. If the GO compiler needs to be run through the target platform? I did a little more reading on this, and decided it's not a concern based on the GO compilation commands in the docker images.
  2. If there are any node modules that pull in architecture dependent native binaries?

@joornby-angel
Copy link
Author

Hi @joornby-angel, thanks for the PR! Good catch with the final images being set to BUILDPLATFORM, we can confirm internally that this is an issue. This PR also unsets the option on the builder stages, which is incorrect. If you can fix this up and rebase/merge in main that'd be great, feel free to re-request my review when that's done.

@endigma Thanks for getting back to me. I updated the PR to explicitly specify the target platform in the final stage so that the image itself documents the intent. Let me know what else you want changed.

@joornby-angel joornby-angel requested a review from endigma October 9, 2025 21:48
@joornby-angel
Copy link
Author

@endigma @miklosbarabas Is there anything else I need to do with this PR to get this moving forward?

@joornby-angel
Copy link
Author

@endigma @miklosbarabas Anything else I can do to move this along?

@miklosbarabas
Copy link
Contributor

@endigma @miklosbarabas Anything else I can do to move this along?

LGTM, @endigma WDYT?

Copy link
Member

@endigma endigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we'll likely need to make our own PR on this commit to make it run CI fully though.

@joornby-angel
Copy link
Author

LGTM, we'll likely need to make our own PR on this commit to make it run CI fully though.

Yeah, that doesn't bother me. I'll be glad to help chase down any issues if some crop up, jus let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants