Skip to content

Add Docker deployment guide for Kamal, Kubernetes, and Control Plane#2837

Merged
justin808 merged 12 commits intomainfrom
jg/docker-deploy-docs
Mar 29, 2026
Merged

Add Docker deployment guide for Kamal, Kubernetes, and Control Plane#2837
justin808 merged 12 commits intomainfrom
jg/docker-deploy-docs

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Mar 25, 2026

Summary

  • Adds a comprehensive Docker deployment guide at docs/oss/deployment/docker-deployment.md covering:
    • Multi-stage Dockerfile for React on Rails (Node at build time, lean runtime)
    • Kamal deployment with config/deploy.yml examples
    • Kubernetes manifests (Deployment, Service, health probes, init containers for migrations)
    • Control Plane deployment with cpflow and workload templates
    • Node Renderer sidecar pattern for Pro users running SSR in containers
    • Static asset / CDN strategies
    • Troubleshooting (missing assets, OOM during build, SSR failures)
  • Updates docs/oss/deployment/README.md with a structured index linking all deployment and troubleshooting guides

Test plan

  • Verify all internal doc links resolve correctly
  • Review Dockerfile example against a real Rails 7.1+ React on Rails app
  • Confirm Kamal, Kubernetes, and Control Plane configs match current best practices

🤖 Generated with Claude Code


Note

Low Risk
Low risk documentation-only changes plus a small link-checker exclude regex tweak; no runtime code paths are affected.

Overview
Adds a new Docker deployment guide covering a production multi-stage Dockerfile, and container-oriented deployment examples for Kamal, Kubernetes, and Control Plane (including SSR/Node Renderer sidecar notes and troubleshooting).

Reorganizes docs/oss/deployment/README.md into a structured index, removes the legacy Capistrano and Elastic Beanstalk pages (linking to git history instead), and updates .lychee.toml to broaden the hvmn.com exclude pattern to match both http/https and optional www.

Written by Cursor Bugbot for commit f8c1ab8. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Documentation

    • Restructured deployment docs with a new TOC, deployment guides, troubleshooting, and archived guides
    • Added a comprehensive Docker deployment guide with multi-environment examples, runtime checklist, asset delivery strategies, and troubleshooting
    • Removed legacy Capistrano and Elastic Beanstalk guides (archived links retained)
    • Updated deployment links to use local relative paths and refreshed two NEWS links to the current docs site
  • Chore

    • Updated link-checker to exclude a flaky external PDF URL

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 25, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Restructured deployment docs: README now links to Docker and Heroku guides and troubleshooting; added a new Docker deployment guide; removed legacy Capistrano and Elastic Beanstalk pages; added a link-checker exclusion; updated two NEWS.md doc URLs.

Changes

Cohort / File(s) Summary
Documentation Restructuring
docs/oss/deployment/README.md
Replaced a single Heroku cross-reference with a structured README (Deployment guides, Troubleshooting, Archived guides) and updated relative link targets to ./ paths.
Docker Deployment Guide Added
docs/oss/deployment/docker-deployment.md
New comprehensive Docker deployment doc: multi-stage Rails build/runtime Dockerfile, pnpm/Corepack notes, runtime env checklist, Kamal/Kubernetes/Control Plane examples, Node renderer container guidance, asset delivery options, and troubleshooting.
Legacy Deployment Guides Removed
docs/oss/deployment/capistrano-deployment.md, docs/oss/deployment/elastic-beanstalk.md
Deleted legacy Capistrano and Elastic Beanstalk deployment pages (setup, config snippets, and troubleshooting content).
Link-checker Exclusion
.lychee.toml
Added a URL exclusion regex for a flaky diva-portal.org PDF to avoid intermittent link-checker failures.
News Entries Updated
NEWS.md
Replaced two identical historical doc URLs (2016-08-27 entries) from https://shakacode.gitbooks.io/... to https://reactonrails.com/docs/.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 I nibbled through docs with careful hops and cheer,
Cleared old deployment trails and welcomed Docker near.
Links tidied, flaky URL tucked away,
News pointed forward, README lights the way.
Hop on, tiny docs — the burrow's neat today! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main addition: a comprehensive Docker deployment guide for three specific platforms (Kamal, Kubernetes, Control Plane).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg/docker-deploy-docs

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.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 25, 2026

Greptile Summary

This PR adds a comprehensive Docker deployment guide (docs/oss/deployment/docker-deployment.md) for React on Rails, covering multi-stage Dockerfiles, Kamal, Kubernetes, and Control Plane deployments, along with a Pro Node Renderer sidecar pattern and troubleshooting tips. The docs/oss/deployment/README.md is also updated with a structured index linking all deployment and troubleshooting guides. The documentation is well-structured and covers the right topics, but contains two factual errors that would cause confusion for users following the guide.

Key findings:

  • cpflow command is incorrect: The Control Plane Deploy section shows cpflow deploy-image -a myapp with the comment # build + push image, but cpflow deploy-image only deploys an already-built image — it does not build or push. The missing cpflow build-image step means users would deploy a stale image without realizing it.
  • Wrong environment variable for Node Renderer URL: The Kubernetes sidecar example sets REACT_ON_RAILS_PRO_NODE_RENDERER_URL, but React on Rails Pro reads ENV["RENDERER_URL"] for the config.renderer_url setting. The custom var name will be silently ignored, leaving the connection pointing to the default http://localhost:3800.
  • node_modules in runtime image: The broad COPY --from=build /rails /rails in the runtime stage inadvertently includes node_modules from the build stage, adding unnecessary size to the production image. This is a P2 optimization suggestion.
  • The docs/oss/deployment/README.md changes are clean — all linked files exist in the repository.

Confidence Score: 3/5

  • The guide is documentation-only, but two factual errors (wrong cpflow command description and wrong env var name) would actively mislead users following the guide in production deployments.
  • Both P1 issues involve incorrect technical information that would cause real operational problems: the cpflow section omits the required build-image step entirely, and the env var name for the Node Renderer URL doesn't match what the gem actually reads. These are not ambiguous edge cases — a user following the guide precisely would either deploy a stale image (cpflow) or have SSR silently falling back to ExecJS (wrong env var). Fixing both P1 issues plus the P2 node_modules note brings this to a clean merge.
  • docs/oss/deployment/docker-deployment.md — specifically the Control Plane deploy commands (lines 376-378) and the Kubernetes Node Renderer env var (line 298-299)

Important Files Changed

Filename Overview
docs/oss/deployment/docker-deployment.md New 450-line Docker deployment guide covering Dockerfile, Kamal, Kubernetes, Control Plane, and Node Renderer sidecar patterns. Contains two factual errors: the cpflow Deploy section uses cpflow deploy-image with an incorrect comment claiming it "builds + pushes" (it only deploys; the build step is cpflow build-image), and the Kubernetes Node Renderer example references env var REACT_ON_RAILS_PRO_NODE_RENDERER_URL which is not read by the gem (the correct var is RENDERER_URL). Internal doc links all resolve correctly. The Dockerfile example works but copies node_modules into the runtime stage unnecessarily.
docs/oss/deployment/README.md Updated deployment index with structured sections linking all deployment guides and troubleshooting docs. All linked files exist in the repository. Clean and well-organized addition.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[docker build] --> B[Base stage\nruby:slim, ENV vars]
    B --> C[Build stage]
    C --> D[Install build deps\napt-get: build-essential, node-gyp]
    D --> E[Install Node.js via nodesource\n+ corepack enable]
    E --> F[bundle install\nRuby gems]
    F --> G[yarn install --frozen-lockfile\nJS dependencies]
    G --> H[COPY . .\nFull application]
    H --> I[assets:precompile\nBuilds client + server bundles]
    I --> |public/webpack/production/\nssr-generated/| J[Runtime stage\nFROM base — no Node]
    J --> K[apt-get: curl libpq5 only]
    K --> L[COPY gems from build\n/usr/local/bundle]
    L --> M[COPY app from build\n/rails — includes node_modules⚠️]
    M --> N[Create non-root user\nrails:1000]
    N --> O[ENTRYPOINT + CMD\npuma -C config/puma.rb]

    style I fill:#90EE90
    style M fill:#FFD700
Loading

Reviews (1): Last reviewed commit: "Add Docker deployment guide for Kamal, K..." | Re-trigger Greptile

Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md Outdated
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md Outdated
Comment thread docs/oss/deployment/docker-deployment.md Outdated
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 25, 2026

Review: Docker Deployment Guide - solid addition overall. Six issues flagged via inline comments: (1) COPY --from=build /rails /rails inflates runtime image with full source tree - line 72; (2) --frozen-lockfile is Yarn v1, Yarn Berry uses --immutable - line 52; (3) pnpm@latest is non-deterministic, pin the version - line 99; (4) misleading K8s Secrets tip since the manifest already uses secretKeyRef correctly - line 263; (5) :latest tag is an anti-pattern in K8s manifests - lines 186 and 383; (6) curl-pipe-bash nodesource install lacks a supply-chain security note - line 40. Minor: missing namespace in K8s manifest, docker-entrypoint requires Rails 7.1+, ssr-generated/ path is Pro-specific.

Comment thread docs/oss/deployment/README.md
Comment thread docs/oss/deployment/README.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md Outdated
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 26, 2026

Review summary

Good addition - Docker deployment docs are genuinely missing from the project. A few issues to fix before merging.

Blocking

  1. Broken archived-guide links (README.md lines 20-21): The commit SHAs b3d30a15c and a5312aeb6 do not exist in this repository. Both files were last present in commit 0c8fc56623cd2cf404a6bda43a3769e1d0e1aafb. Inline suggestions have been posted.

  2. Wrong Node Renderer env var (docker-deployment.md lines 376-377): REACT_ON_RAILS_PRO_NODE_RENDERER_URL does not appear anywhere in the codebase. The Rails Pro config API uses config.renderer_url, typically sourced from ENV["REACT_RENDERER_URL"] (see docs/oss/building-features/node-renderer/basics.md line 95). Using the wrong env var means the sidecar connection silently falls back to localhost:3800 with no obvious error.

  3. Incorrect cpflow commands (docker-deployment.md line 350): cpflow deploy-image deploys an already-built image; it does not build one. The build step is cpflow build-image. Inline suggestion posted.

Non-blocking

  1. Missing security caveat for host: 0.0.0.0 (docker-deployment.md line 400): The js-configuration.md warns that binding to all interfaces is a security risk. This guide should repeat that caveat since the example YAML is easy to copy verbatim.

  2. --frozen-lockfile vs --immutable (docker-deployment.md line 52): --frozen-lockfile is Yarn Classic only; Yarn Berry uses --immutable. Since the Dockerfile enables corepack right above this line, Berry is a realistic scenario. Inline suggestion posted.

  3. README missing two existing troubleshooting files: troubleshooting-when-using-shakapacker.md and troubleshooting-when-using-webpacker.md exist in the same directory but are not linked from the new README index. Worth either linking them or explicitly noting as archived so they are not orphaned.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 26, 2026

Good documentation addition overall — the multi-stage Dockerfile, Kamal/K8s/Control Plane examples, and Node Renderer sidecar patterns are all useful. A few issues worth addressing:

Critical

  • The Node Renderer sidecar example uses your-registry/myapp:latest (the Ruby runtime image), but that image has no node binary and no node_modules. The text correctly states "the runtime image needs Node.js" but doesn't show how to provide it. The sidecar container as written would crash at startup. This section needs either a separate Node-capable image or a variant Dockerfile that keeps Node.js in the runtime stage.

Notable

  • yarn install --frozen-lockfile is Yarn 1.x / 3.x syntax. If users follow the guide and corepack enable activates Yarn 4 (the current default), the flag is silently ignored on some versions or rejected on others. Yarn 4 uses --immutable. Since the guide enables corepack, it should account for this.
  • corepack prepare pnpm@latest --activate is non-deterministic — using latest means different builds can pull different pnpm versions. Pin a specific version (e.g. [email protected]).

Minor

  • The K8s resource limits (memory: 512Mi) are probably too low for pods doing ExecJS/mini_racer SSR. A note suggesting users tune this (or a higher example value like 1Gi) would help avoid OOM kills in production.
  • The node-gyp apt package is the Debian wrapper, not the npm package. Once Node.js is installed from nodesource, npm-installed node-gyp (pulled in by native addons) is what actually runs. The apt node-gyp package may conflict or shadow the npm version — worth checking if it's needed here.

Comment thread docs/oss/deployment/docker-deployment.md Outdated
Comment thread docs/oss/deployment/docker-deployment.md Outdated
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 26, 2026

Review: Docker Deployment Guide

Overall this is a solid, well-organized addition with good security practices (non-root user, secrets via secretKeyRef). A few issues worth addressing:

Issue 1 - curl-pipe-bash in the Dockerfile (security): The Node.js install step uses curl piped to bash, which executes remotely fetched code directly and is a well-known supply-chain risk. Consider explicit APT pinning or switching to a Node base image for the build stage. At minimum, add a note acknowledging the trade-off.

Issue 2 - livenessProbe.initialDelaySeconds 15 is too short for Rails: Puma with Rails + React on Rails commonly takes 30-60 s to start on a cold deploy. A liveness probe firing at 15 s will restart the pod before it is ready, creating a crash loop. Recommend at least 60 s, or suggest startupProbe (Kubernetes 1.18+).

Issue 3 - Memory limit of 512 Mi is borderline for SSR workloads: limits.memory 512Mi will cause OOM kills for many real-world apps doing server-side rendering. The guide should note this is a minimal starting point and suggest 1-2 Gi for SSR-enabled apps.

Issue 4 - ssr-generated/ path is React on Rails Pro-specific: The Key points section says server bundles land in ssr-generated/. This is specific to the Pro Node Renderer, not the default ExecJS/mini_racer path. OSS users will be confused. Should be qualified with (React on Rails Pro only) or replaced with the OSS-accurate output path.

Issue 5 - Missing .dockerignore guidance: The COPY . . step will silently include .git/, node_modules/, log/, tmp/, and local .env files without a .dockerignore. Worth a brief note since this affects build performance and potential secrets exposure.

Minor nits: The Kamal config/deploy.yml uses 192.168.0.1 as a placeholder server IP (a private RFC1918 address). 203.0.113.1 (TEST-NET-3, reserved for documentation) would be clearer. Archived-guide commit SHAs in README are partial (9 chars); full 40-char SHAs are more stable for long-term permalink links.

The issues above are all actionable and worth fixing before merge.

Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 29, 2026

Review: Docker Deployment Guide

Overall this is a well-structured, thorough guide that fills a real gap in the docs. The multi-stage Dockerfile design is correct (Node only at build time, lean runtime image, non-root user, --immutable lockfile install), the Kubernetes manifest follows current best practices (secretKeyRef, readiness/liveness probes, init container migration warning), and removing the stale Capistrano/Elastic Beanstalk guides is the right call.

A few things worth addressing before merge:

Correctness / usability

  • README.md intro: The first sentence about Shakapacker is a leftover from the old file and no longer fits the index format. (Inline comment added.)
  • ExecJS SSR troubleshooting: The suggestion to install mini_racer or add node to the runtime PATH conflicts with the guide's own multi-stage design — the runtime image is deliberately Node-free and uses the Ruby slim base, which lacks build tools for mini_racer. Worth being explicit about the tradeoff. (Inline comment added.)
  • node-renderer.js command: The origin/purpose of this file is opaque to readers new to the Pro Node Renderer; a short cross-reference would help. (Inline comment added.)

Reproducibility

  • Image version pinning: Defaulting to RUBY_VERSION=3.3 and NODE_VERSION=20 means the base image can silently change between CI runs. Pinning to patch versions (e.g. 3.3.7, 20.19.0) is standard practice for production Dockerfiles. (Inline comment with suggestion added.)

Minor nits (no blocking issues)

  • docker exec <container> in the troubleshooting section uses angle-bracket placeholders that can render oddly depending on the Markdown renderer — backtick-quoting the placeholder (<container-id>) would be safer.
  • The .dockerignore example is intentionally minimal, but .bundle/ and .env* are worth calling out explicitly since they're common sources of secrets accidentally leaking into image layers.
  • Control Plane workload template is missing a scale block — the defaults are fine for a getting-started guide, but readers trying to run zero-downtime deployments will need it. Even a comment noting this would help.

justin808 and others added 11 commits March 28, 2026 17:34
Covers multi-stage Dockerfile setup for React on Rails, environment
variables, platform-specific configuration for all three deployment
targets, Node Renderer sidecar patterns, CDN/static asset strategies,
and common troubleshooting scenarios.

Also updates the deployment README with a structured index of all
deployment and troubleshooting guides.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Both guides referenced very old tooling (Node 6, public/packs, etc.)
and are no longer relevant. Links to the last versions are preserved
in the deployment README for anyone who still needs them.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Fix cpflow commands: use build-image (build+push) then deploy-image (deploy),
  not deploy-image then deploy
- Fix env var: REACT_ON_RAILS_PRO_NODE_RENDERER_URL -> REACT_RENDERER_URL
  (matching the canonical Pro template)
- Reword K8s Secrets tip to not contradict the manifest which already uses
  secretKeyRef correctly

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add `RUN rm -rf node_modules` after assets:precompile in the build
stage so the broad `COPY --from=build /rails /rails` does not carry
JS dependencies into the runtime image unnecessarily.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Fix node-renderer sidecar to use separate Node-enabled image
- Add initializer note for REACT_RENDERER_URL env var
- Complete initContainers env block with secretKeyRef entries
- Add missing Shakapacker/Webpacker troubleshooting links to README

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Wrap config.renderer_url in ReactOnRailsPro.configure block to
  prevent NoMethodError at boot
- Add .dockerignore bullet to Key Points section to prevent host
  node_modules from overwriting Docker-installed modules

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…ion warning

- Pin pnpm to major version instead of @latest for reproducible builds
- Add Yarn Berry --immutable note alongside --frozen-lockfile
- Add language tag to .dockerignore fenced code block (MD040)
- Increase livenessProbe initialDelaySeconds to 60s for SSR apps
- Add warning about initContainer migrations with replicas > 1

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The Control Plane template omitted initialDelaySeconds and periodSeconds,
unlike the Kubernetes example. Without these, the liveness probe fires at
t=0 before Rails boots, causing a crash loop.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…re, default to Yarn Berry

- Remove curl from runtime stage (only needed in build stage for nodesource)
- Expand .dockerignore example with spec, test, .github entries
- Default yarn install flag to --immutable (Yarn Berry) since corepack
  activates the version from packageManager in package.json

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@justin808 justin808 force-pushed the jg/docker-deploy-docs branch from 90e62c6 to 8d2361d Compare March 29, 2026 03:35
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 29, 2026

Review: Docker Deployment Guide

Overall this is a well-structured, comprehensive doc addition. The multi-stage Dockerfile, deployment patterns (Kamal/K8s/Control Plane), and troubleshooting sections are solid. A few accuracy and security issues worth addressing:

1. NodeSource curl-pipe-bash installer (security)

The build stage installs Node by piping a remote script directly into bash. This is a supply-chain risk. For production Dockerfiles, consider using the official node Docker base image in a separate stage, or verify the script checksum. At minimum, add a note acknowledging this trade-off.

2. Kamal arch: amd64 hardcodes x86_64

The Kamal config example includes builder.arch: amd64. This silently breaks for developers on Apple Silicon who run kamal deploy locally. The doc should note that amd64 targets Linux servers specifically and point to multi-arch builds if needed.

3. Asset path public/webpack/production/ is bundler-specific

The Troubleshooting section references public/webpack/production/ as the client bundle output path. This is correct for Shakapacker/Webpacker but differs for Rspack projects (varies by output_path config). Suggest phrasing it as the configured public_output_path (defaults to public/webpack/production/) so readers know to adjust.

4. ssr-generated/ description could be clearer

The guide says server bundles land in ssr-generated/. That is the default for Shakapacker private_output_path but is configurable. A parenthetical like "(the default private_output_path; adjust to match your bundler config)" would help.

Minor: The pnpm section pins pnpm@9 in corepack prepare pnpm@9 --activate. The inline comment says to pin to your major version, but readers may copy it verbatim. A suggestion to match the version in packageManager in package.json would help.

Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
…g wording

- Remove leftover Shakapacker sentence from deployment README that no
  longer fits the new index format
- Reword SSR troubleshooting to acknowledge the multi-stage design and
  recommend mini_racer or the Pro Node Renderer sidecar instead of
  vaguely suggesting adding Node to the runtime stage

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
Comment thread docs/oss/deployment/docker-deployment.md
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 29, 2026

Review: Docker Deployment Guide

Good addition overall. Well-structured, covers the key deployment targets (Kamal, Kubernetes, Control Plane), and the React on Rails-specific callouts (SSR bundle path, Node Renderer sidecar, SECRET_KEY_BASE_DUMMY) are accurate against the codebase.

I left five inline comments with specific fixable issues.

1. Missing mkdir -p before chown (line 80) — log/, tmp/, storage/ are gitignored and typically absent from the image after the multi-stage copy. The chown command will fail. Rails 7.1's own default Dockerfile uses mkdir -p first.

2. COPY . . silently overwrites node_modules (line 55) — without a .dockerignore excluding node_modules, the host's native modules overwrite the container-built ones, causing hard-to-diagnose runtime crashes. This is covered in Key Points, but a comment inline in the Dockerfile would catch it before someone skips ahead.

3. Wrong node-renderer.js path (line 413) — the generator places the file at client/node-renderer.js (per pro_setup.rb); the command as written will error unless the container working directory happens to be client/.

4. pnpm@9 hardcoded (line 113) — silently ignores the packageManager version in package.json; projects on pnpm v8 or v10 get the wrong version installed.

5. :latest tag in Kubernetes manifest (line 222) — using :latest in production prevents reliable rollbacks and makes it impossible to audit exactly what is deployed. Recommend a versioned tag placeholder.

Minor (not blocking): The archived git links in README.md use 9-char abbreviated commit hashes — full 40-char SHAs are more future-proof. The Kamal example sets memory: 512m on the web container, which is tight for a Rails + SSR app; a note about typical runtime memory needs would help users avoid OOM kills in production.

@justin808 justin808 merged commit a77f59b into main Mar 29, 2026
61 checks passed
@justin808 justin808 deleted the jg/docker-deploy-docs branch March 29, 2026 08:39
justin808 added a commit that referenced this pull request Mar 29, 2026
…e-repo

* origin/main:
  Improve create-react-on-rails-app fresh app onboarding (#2849)
  Add Docker deployment guide for Kamal, Kubernetes, and Control Plane (#2837)
  Reframe RSC migration docs around React on Rails patterns (#2661)
  Enforce secure renderer password defaults for production-like envs (#2829)
justin808 added a commit that referenced this pull request Mar 29, 2026
Add docker-deployment doc and remove deleted capistrano-deployment
and elastic-beanstalk entries (archived in PR #2837).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant