Skip to content

Added Dockerfile support#33

Merged
make-ki merged 4 commits intoOpenverse-iiitk:mainfrom
make-ki:main
Jul 28, 2025
Merged

Added Dockerfile support#33
make-ki merged 4 commits intoOpenverse-iiitk:mainfrom
make-ki:main

Conversation

@make-ki
Copy link
Copy Markdown
Contributor

@make-ki make-ki commented Jul 27, 2025

heres chatgpt saying why?
Even though the site is static and can be built using npm run build, using Docker gives us several benefits:
Consistent environment for everyone, no matter what OS or setup they have.
No need to install Node.js or npm locally — everything runs inside the container.
Easier to deploy the site to servers or cloud platforms without dealing with system dependencies.
The site is served using a proper web server like Nginx, which is more suitable for production than a development server.
This makes things simpler for the team and ensures the site behaves the same everywhere.

Summary by CodeRabbit

  • New Features
    • Added Docker support for building and running the application in a containerized environment.
  • Documentation
    • Updated README with instructions for building and running the project using Docker, including port configuration details.

make-ki added 2 commits July 27, 2025 12:44
I have added Dockerfile instruction in the README, so peeps new to docker can use it asw
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 27, 2025

"""

Walkthrough

A new multi-stage Dockerfile was added to containerize the application, enabling production builds and static file serving via nginx. The README.md was updated with detailed instructions for building and running the Docker container, including port mapping guidance and usage notes. A .dockerignore file was added to exclude unnecessary files and directories from the Docker build context.

Changes

File(s) Change Summary
Dockerfile Added a multi-stage Dockerfile for building and serving the app with Node.js 20 Alpine and nginx Alpine images.
README.md Updated with Docker build and run instructions, including port mapping and alternative deployment methods.
.dockerignore Added to exclude node_modules, dist, .git, and .vscode from the Docker build context to optimize build size.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

🐇
In Docker’s warren, code now hops,
From Node to nginx, the building never stops.
README’s grown with wisdom to share,
Run containers with ease, no setup to spare.
Ports mapped and ready, let’s celebrate—
With every hop, deployment’s first-rate!
🚢
"""

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c3bd8f1 and 47d9b2c.

📒 Files selected for processing (1)
  • .dockerignore (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .dockerignore
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 generate unit tests to generate unit tests for 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
Copy Markdown
Contributor

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

🧹 Nitpick comments (2)
Dockerfile (1)

8-12: Pin base image versions & add healthcheck

nginx:alpine always pulls the latest patch, which may introduce breaking changes unexpectedly. Pin to a specific minor (e.g. nginx:1.25-alpine) and surface container health to orchestrators.

-FROM nginx:alpine
+FROM nginx:1.25-alpine

 EXPOSE 80
-CMD ["nginx", "-g", "daemon off;"]
+HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://localhost:80/ || exit 1
+CMD ["nginx", "-g", "daemon off;"]

This improves reproducibility and operational readiness.

README.md (1)

75-80: Consider aligning image name with repository

algorithima is not obviously linked to DSA-Website. Using a predictable namespace (e.g. dsa-website:latest) aids discoverability in registries and prevents naming collisions.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3d6fb61 and 279b0be.

📒 Files selected for processing (2)
  • Dockerfile (1 hunks)
  • README.md (1 hunks)
🔇 Additional comments (1)
README.md (1)

71-81: Minor wording & command tweaks

  • “isolately” → “in isolation”.
  • Clarify that the site will be served at http://localhost:1234.
  • Encourage deterministic image tags and document optional port override env.
-You can also build a docker image and run the build isolately, without any setup overhead.
+You can also build and run the project in isolation via Docker, with zero local setup.

 docker build -t algorithima:latest .

-# To run the image
-docker run -d --name dsa_website \
-           -p 1234:80 \
-           algorithima:latest
-# Build will be running on port localhost:1234, if the port is busy, put another port in docker run command.
+# Run container (change 1234 if the port is occupied)
+docker run -d --name dsa_website \
+           -p 1234:80 \
+           algorithima:latest
+
+# The site is now available at http://localhost:1234

[nitpick]

@make-ki
Copy link
Copy Markdown
Contributor Author

make-ki commented Jul 27, 2025

for some reason the .dockerignore didn't decrease the image size at all, but atleast the image layer caching issue is fixed.

@make-ki make-ki merged commit 569220d into Openverse-iiitk:main Jul 28, 2025
1 of 2 checks passed
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