Skip to content

added dockerfile #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

yoav0gal
Copy link

@yoav0gal yoav0gal commented Jun 9, 2025

run bun update as well,
feel free to change the ports if you want to stay on 3001

Summary by CodeRabbit

  • New Features

    • Added Docker support for building and running the application in a containerized environment.
    • Introduced npm scripts to build, run, and stop Docker containers easily.
  • Dependency Updates

    • Upgraded several dependencies and peer dependencies to newer versions for improved compatibility and stability.
    • Added a new development tool for code quality.
  • Chores

    • Improved package configuration for better build and run management.

Copy link

coderabbitai bot commented Jun 9, 2025

Walkthrough

A Dockerfile was added to containerize the application using the Bun runtime, including build and run steps. The package.json was updated with new Docker-related scripts, dependency upgrades, and the addition of a new development tool. No code-level exports or public entity declarations were changed.

Changes

File(s) Change Summary
Dockerfile Added new Dockerfile for Bun-based containerization, build, and runtime configuration.
package.json Added Docker scripts, updated devDependencies, peerDependencies, and dependencies; fixed a script.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Docker
    participant Bun Runtime
    participant App

    Developer->>Docker: Build image (docker:build)
    Docker->>Bun Runtime: Install dependencies (bun install)
    Docker->>Bun Runtime: Build app (bun run build)
    Developer->>Docker: Run container (docker:run)
    Docker->>Bun Runtime: Start app (bun run start:http)
    Bun Runtime->>App: Serve on PORT (default 3000)
Loading

Poem

In a Docker burrow, Bun now brews,
With scripts and tools both fresh and new.
Dependencies hop to the latest tune,
The server’s ready—launch it soon!
A rabbit’s cheer for builds so bright,
Container dreams take flight tonight.
🐇✨


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 0

🧹 Nitpick comments (3)
Dockerfile (2)

2-12: Use a multi-stage build to optimize image size.

Splitting into a builder and runner stage separates build-time dependencies from your production image and reduces final footprint:

# Stage 1: install deps & build
FROM oven/bun:1.2-alpine AS builder
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install
COPY . .
RUN bun run build

# Stage 2: production runtime
FROM oven/bun:1.2-alpine AS runner
WORKDIR /app
COPY --from=builder /app/build /app/build
COPY package.json bun.lock ./
RUN bun install --production
ARG PORT=3000
ENV PORT=${PORT}
EXPOSE ${PORT}
CMD ["bun", "run", "start:http"]

This pattern will speed up rebuilds and shrink the final image.


1-20: Add a .dockerignore to speed up builds.

Exclude things like node_modules, .git and local config files to keep your context light. For example:

node_modules
.git
.env
npm-debug.log
.DS_Store
build

This prevents re-sending large or irrelevant files on each build.

package.json (1)

34-37: Allow overriding the container PORT at build and run time.

Currently the Docker scripts are hardcoded to 3000. To respect the ARG PORT in your Dockerfile and let consumers switch ports more easily, update them as follows:

-    "docker:build": "docker build -t typescript-mcp-server-template .",
-    "docker:run":  "docker run --name typescript-mcp-server-template -p 3000:3000 --env-file .env typescript-mcp-server-template",
+    "docker:build": "docker build --build-arg PORT=${PORT:-3000} -t typescript-mcp-server-template .",
+    "docker:run":  "docker run --name typescript-mcp-server-template -p ${PORT:-3000}:${PORT:-3000} --env-file .env --env PORT=${PORT:-3000} typescript-mcp-server-template",
     "docker:stop": "docker stop typescript-mcp-server-template"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ec108b and d5f6678.

📒 Files selected for processing (2)
  • Dockerfile (1 hunks)
  • package.json (2 hunks)
🔇 Additional comments (4)
Dockerfile (1)

14-18: Verify your app honors the PORT build‐arg and env var.

You expose ${PORT} in the Dockerfile, but ensure bun run start:http reads process.env.PORT (or equivalent) so the port arg actually takes effect at runtime.

package.json (3)

65-68: DevDependencies additions look good.
Adding @biomejs/biome, @types/cors and @types/node aligns with the Docker build and TS usage.


72-74: PeerDependencies additions look good.
@valibot/to-json-schema, effect, and typescript are correctly specified for consumers.


78-79: Dependencies additions look good.
Including fastmcp and zod matches the project’s runtime requirements.

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