Skip to content

feat: add --host flag to CLI and fix Docker setup#30

Merged
rsbh merged 4 commits intomainfrom
fix_docker_host
Apr 8, 2026
Merged

feat: add --host flag to CLI and fix Docker setup#30
rsbh merged 4 commits intomainfrom
fix_docker_host

Conversation

@rsbh
Copy link
Copy Markdown
Member

@rsbh rsbh commented Apr 8, 2026

Summary

  • Add --host flag (default: localhost) to dev, start, and serve commands for Docker port mapping
  • Fix Dockerfile: copy node_modules to runner stage (fixes Cannot find module 'fumadocs-core/mdx-plugins')
  • Change Docker working directory from /docs to /content

Test plan

  • Docker build succeeds
  • docker run -p 4000:3000 chronicle-test returns HTTP 200
  • --host 0.0.0.0 exposes network address in container
  • chronicle dev --host 0.0.0.0 works locally

🤖 Generated with Claude Code

rsbh and others added 2 commits April 8, 2026 12:50
Allows binding to a custom host address (defaults to localhost).
Use --host 0.0.0.0 for Docker container port mapping.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add --host flag (default: localhost) to dev, start, and serve commands
for Docker container port mapping. Fix Dockerfile by copying node_modules
to runner stage and using /content as working directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Warning

Rate limit exceeded

@rsbh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 0 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 0 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 69acfba9-78aa-4ebc-8db7-971b1fbee703

📥 Commits

Reviewing files that changed from the base of the PR and between 6ae052a and 77a1a53.

📒 Files selected for processing (1)
  • Dockerfile
📝 Walkthrough

Walkthrough

Adds a --host <host> option (default localhost) to dev/start/serve CLI commands, passes it into Vite server/preview, updates Dockerfile to use /content (instead of /docs), copies node_modules into runner stage, and runs the container binding the server to 0.0.0.0.

Changes

Cohort / File(s) Summary
Docker Configuration
Dockerfile
Changed working dir and persisted path from /docs to /content, updated COPY destinations, added copying of /app/node_modules into runner stage, changed runtime command to include --host 0.0.0.0, and updated VOLUME to /content.
CLI Host Options
packages/chronicle/src/cli/commands/dev.ts, packages/chronicle/src/cli/commands/serve.ts, packages/chronicle/src/cli/commands/start.ts
Added --host <host> option (default localhost) and pass host: options.host into Vite server/preview configuration for each command.
Documentation
docs/cli.mdx, docs/docker.mdx
Documented the new --host flag and updated Docker examples/instructions to reflect mounting and using /content instead of /docs/content.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • rohilsurana
  • rohanchkrabrty
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding a --host flag to CLI commands and fixing Docker setup issues.
Description check ✅ Passed The description clearly relates to the changeset, outlining the key modifications with specific details about the --host flag, Dockerfile fixes, and directory changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix_docker_host

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/chronicle/src/cli/commands/serve.ts (1)

40-43: Consider spreading existing preview config for consistency.

In dev.ts, the server config is spread with { ...config.server, port, host } to preserve any existing settings. Here, preview: { port, host } overwrites the entire preview config. For consistency and to avoid losing any preview settings from createViteConfig, consider spreading:

♻️ Suggested change
     const server = await preview({
       ...config,
-      preview: { port, host: options.host }
+      preview: { ...config.preview, port, host: options.host }
     });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/chronicle/src/cli/commands/serve.ts` around lines 40 - 43, The
preview call currently overwrites any existing preview settings from
createViteConfig by passing preview: { port, host }; change it to merge the
existing preview config so you preserve prior options—i.e., when calling
preview(...) spread the existing config.preview and then set port and host (use
symbols: preview, config, port, options.host, preview(...) ) so existing preview
settings aren't lost.
packages/chronicle/src/cli/commands/start.ts (1)

23-26: Consider spreading existing preview config for consistency.

Same as serve.ts - consider spreading to preserve any existing preview settings:

♻️ Suggested change
     const server = await preview({
       ...config,
-      preview: { port, host: options.host }
+      preview: { ...config.preview, port, host: options.host }
     });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/chronicle/src/cli/commands/start.ts` around lines 23 - 26, The
preview call in start.ts overwrites any existing preview settings in config;
update the object passed to preview({ ...config, preview: { port, host:
options.host } }) to merge existing config.preview instead—e.g., call preview
with preview: { ...(config.preview || {}), port, host: options.host }—so the
preview function (preview) receives preserved settings from the config.preview
object while overriding port and host from port and options.host.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Dockerfile`:
- Line 33: The Dockerfile now declares VOLUME /content but docs/docker.mdx still
uses the old mount path /docs/content; update all occurrences in docs/docker.mdx
(there are 9 references) to use /content instead so examples, CLI flags, and
mount instructions match the Dockerfile's VOLUME /content declaration; ensure
examples, installation steps, and any copy/paste shell commands referencing
/docs/content are replaced with /content.

---

Nitpick comments:
In `@packages/chronicle/src/cli/commands/serve.ts`:
- Around line 40-43: The preview call currently overwrites any existing preview
settings from createViteConfig by passing preview: { port, host }; change it to
merge the existing preview config so you preserve prior options—i.e., when
calling preview(...) spread the existing config.preview and then set port and
host (use symbols: preview, config, port, options.host, preview(...) ) so
existing preview settings aren't lost.

In `@packages/chronicle/src/cli/commands/start.ts`:
- Around line 23-26: The preview call in start.ts overwrites any existing
preview settings in config; update the object passed to preview({ ...config,
preview: { port, host: options.host } }) to merge existing config.preview
instead—e.g., call preview with preview: { ...(config.preview || {}), port,
host: options.host }—so the preview function (preview) receives preserved
settings from the config.preview object while overriding port and host from port
and options.host.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 14db3b28-cfe9-418f-8540-dec4a80de6ea

📥 Commits

Reviewing files that changed from the base of the PR and between 2bd664c and 8726b3f.

📒 Files selected for processing (4)
  • Dockerfile
  • packages/chronicle/src/cli/commands/dev.ts
  • packages/chronicle/src/cli/commands/serve.ts
  • packages/chronicle/src/cli/commands/start.ts

Update cli.mdx with --host flag for dev, start, and serve commands.
Update docker.mdx to use /content mount path matching Dockerfile changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace copying full node_modules with bun install --production in the
runner stage for a smaller image with only runtime dependencies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rsbh rsbh merged commit 6896b08 into main Apr 8, 2026
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.

2 participants