Repository navigation
feat(deploy): distroless runtime and private key via env var - #42
Conversation
amintalebi
commented
Jun 14, 2026
- Use gcr.io/distroless/cc-debian12:debug-nonroot to skip apt and restore the built-in HEALTHCHECK via busybox wget.
- Read ERC4337_BUNDLER_PRIVATE_KEY directly from the environment, like the RPC URL, removing the /run/secrets/bundler_private_key file mount.
- Update docker-compose.yml, docs/DEPLOYMENT.md and .env.example accordingly.
- Remove obsolete secrets/ example file.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR transitions the bundler runtime to a distroless ChangesDistroless Image Migration and Env-Var Key Delivery
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request transitions the bundler deployment from using Docker secrets/file mounts for the private key to using a plaintext environment variable (ERC4337_BUNDLER_PRIVATE_KEY). It also migrates the runtime container to a distroless base image (gcr.io/distroless/cc-debian12:debug-nonroot) and updates the healthcheck to use busybox's wget. Feedback highlights two key security and architectural concerns: first, exposing the private key in environment variables introduces a security regression, and it is recommended to support reading the key from a file path instead; second, using the debug variant of the distroless image in production increases the attack surface, and implementing a native healthcheck subcommand in the Go binary would allow using the standard, more secure nonroot image.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docker-compose.yml`:
- Around line 24-27: The ERC4337_BUNDLER_PRIVATE_KEY is currently sourced only
from an environment variable, which increases security exposure in production.
Modify the docker-compose.yml configuration to support file-backed secrets for
the bundler private key. Add a volume mount for a secrets file path and update
the ERC4337_BUNDLER_PRIVATE_KEY setting to read from the mounted secret file in
production while maintaining the environment variable fallback for local
development convenience. This ensures the private key can be managed as a
file-mounted secret in production deployments while keeping developer experience
intact for local setups.
In `@docs/DEPLOYMENT.md`:
- Around line 23-26: The fenced code block in the "Set required config" section
is missing a language identifier on the opening fence, which violates the
markdownlint MD040 rule. Add a language tag (such as env or sh) to the opening
triple backticks (```) to specify the code block type. This will help with
syntax highlighting and satisfy the linter requirement.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 96cc69cf-98d6-4b7a-90e0-f2fb8871c1c3
📒 Files selected for processing (5)
.env.exampleDockerfiledocker-compose.ymldocs/DEPLOYMENT.mdsecrets/bundler_private_key.txt.example
💤 Files with no reviewable changes (1)
- secrets/bundler_private_key.txt.example
- Use gcr.io/distroless/cc-debian12:debug-nonroot to skip apt and restore the built-in HEALTHCHECK via busybox wget. - Read ERC4337_BUNDLER_PRIVATE_KEY directly from the environment, like the RPC URL, removing the /run/secrets/bundler_private_key file mount. - Update docker-compose.yml, docs/DEPLOYMENT.md and .env.example accordingly. - Remove obsolete secrets/ example file.
4b3e204 to
efa6c24
Compare