feat: add --host flag to CLI and fix Docker setup#30
Conversation
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>
|
Warning Rate limit exceeded
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 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. 📝 WalkthroughWalkthroughAdds a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 fromcreateViteConfig, 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
📒 Files selected for processing (4)
Dockerfilepackages/chronicle/src/cli/commands/dev.tspackages/chronicle/src/cli/commands/serve.tspackages/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>
Summary
--hostflag (default:localhost) todev,start, andservecommands for Docker port mappingnode_modulesto runner stage (fixesCannot find module 'fumadocs-core/mdx-plugins')/docsto/contentTest plan
docker run -p 4000:3000 chronicle-testreturns HTTP 200--host 0.0.0.0exposes network address in containerchronicle dev --host 0.0.0.0works locally🤖 Generated with Claude Code