Skip to content
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

feat: docker deployment #16

Merged
merged 8 commits into from
Dec 21, 2024
Merged

feat: docker deployment #16

merged 8 commits into from
Dec 21, 2024

Conversation

macintushar
Copy link
Owner

@macintushar macintushar commented Dec 21, 2024

This PR solves Issue #14

Summary by CodeRabbit

  • New Features

    • Introduced a web server using the Hono framework.
    • Added a new service configuration for draw-ui in Docker.
  • Dependencies

    • Added new dependencies: bun and hono.
    • Added new development dependency: @types/bun.
  • Documentation

    • Updated Dockerfile and docker-compose.yml for improved build and service management.
  • Chores

    • Introduced new TypeScript build information files for better incremental compilation tracking.

@macintushar macintushar self-assigned this Dec 21, 2024
Copy link

vercel bot commented Dec 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
draw ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2024 9:56pm

Copy link

coderabbitai bot commented Dec 21, 2024

Warning

Rate limit exceeded

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

⌛ 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 3c6bf1f and 85e6606.

📒 Files selected for processing (4)
  • Dockerfile (1 hunks)
  • docker-compose.yml (1 hunks)
  • docs/self-hosting.md (1 hunks)
  • server.ts (1 hunks)

Walkthrough

The pull request introduces a new web application setup using the Bun runtime, Hono framework, and Docker containerization. The changes include creating a multi-stage Dockerfile, updating the docker-compose configuration, adding new dependencies to package.json, and introducing a new server.ts file for handling web server functionality. The configuration focuses on creating a lightweight, efficient deployment process for a web application, with emphasis on static file serving and environment configuration.

Changes

File Change Summary
Dockerfile Multi-stage build process introduced for Node.js application using Bun runtime
docker-compose.yml Added draw-ui service configuration
package.json Added dependencies: bun@^1.1.42, hono@^4.6.14; Added dev dependency: @types/bun@^1.1.14
server.ts New file creating web server using Hono, with static file serving and environment variable configuration
tsconfig.app.tsbuildinfo New JSON structure for TypeScript build information, including root files and version number
tsconfig.node.tsbuildinfo New file for TypeScript build information, pointing to vite.config.ts and version number

Sequence Diagram

sequenceDiagram
    participant Docker as Dockerfile
    participant Build as Build Stage
    participant Serve as Serve Stage
    participant Server as Bun Server

    Docker->>Build: Copy source code
    Build-->>Build: Install dependencies
    Build->>Build: Compile application
    Docker->>Serve: Copy compiled dist
    Serve-->>Serve: Install runtime dependencies
    Serve->>Server: Start server on port 3729
Loading

Poem

🐰 A Bunny's Build Adventure 🚀

With Hono and Bun, we dance and deploy,
Dockerfiles spinning our code with joy!
Static files served, ports open wide,
A runtime so nimble, with rabbit's pride!
Containers leaping, technology's delight! 🌈


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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: 7

🔭 Outside diff range comments (1)
package.json (1)

Security vulnerabilities found in multiple dependencies - Updates required

Several dependencies have known security vulnerabilities:

  • [email protected]: Vulnerable to Prototype Pollution (Moderate) - Update to >= 1.1.30
  • [email protected]: Multiple vulnerabilities found:
    • CSRF Middleware bypass (Moderate) - Update to >= 4.6.5
    • Directory Traversal in serveStatic (Moderate)
    • Named path parameters override in TrieRouter (Moderate)
  • @excalidraw/[email protected]: Currently using the patched version that fixes XSS vulnerabilities

Recommendations:

  • Update bun to version 1.1.30 or later
  • Update hono to version 4.6.5 or later
  • Keep @excalidraw/excalidraw at current version as it's already patched
  • No vulnerabilities found in @supabase/supabase-js and @sentry/react
🔗 Analysis chain

Line range hint 1-67: Verify dependencies for security vulnerabilities

Let's check for known vulnerabilities in the dependencies.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for security advisories in dependencies

# Check for vulnerabilities in key dependencies
for pkg in "bun" "hono" "@excalidraw/excalidraw" "@supabase/supabase-js" "@sentry/react"
do
  gh api graphql -f query="
  {
    securityVulnerabilities(first: 5, ecosystem: NPM, package: \"$pkg\") {
      nodes {
        advisory {
          summary
          severity
          publishedAt
        }
        vulnerableVersionRange
        firstPatchedVersion {
          identifier
        }
      }
    }
  }"
done

Length of output: 4506

🧹 Nitpick comments (1)
package.json (1)

24-24: Lock dependency versions for production stability

Using caret ranges (^) for production dependencies can lead to unexpected updates.

-    "bun": "^1.1.42",
+    "bun": "1.1.42",
-    "hono": "^4.6.14",
+    "hono": "4.6.14",

Also applies to: 28-28

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e831746 and 772a4ba.

⛔ Files ignored due to path filters (1)
  • bun.lockb is excluded by !**/bun.lockb
📒 Files selected for processing (6)
  • Dockerfile (1 hunks)
  • docker-compose.yml (1 hunks)
  • package.json (2 hunks)
  • server.ts (1 hunks)
  • tsconfig.app.tsbuildinfo (1 hunks)
  • tsconfig.node.tsbuildinfo (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • tsconfig.node.tsbuildinfo
  • docker-compose.yml
  • tsconfig.app.tsbuildinfo

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
server.ts Outdated Show resolved Hide resolved
server.ts Show resolved Hide resolved
server.ts Outdated Show resolved Hide resolved
@macintushar macintushar merged commit b0b1531 into main Dec 21, 2024
5 checks passed
@macintushar macintushar deleted the feat/docker-deployment branch December 21, 2024 21:56
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