Skip to content

Feat:Add Docker configuration for client and server, including .docke…#218

Open
YogeshVenugopal wants to merge 3 commits intoadrianhajdin:PART_1_and_2from
YogeshVenugopal:PART_1_and_2
Open

Feat:Add Docker configuration for client and server, including .docke…#218
YogeshVenugopal wants to merge 3 commits intoadrianhajdin:PART_1_and_2from
YogeshVenugopal:PART_1_and_2

Conversation

@YogeshVenugopal
Copy link
Copy Markdown

@YogeshVenugopal YogeshVenugopal commented Oct 6, 2025

Created Dockerfile for client, server and Database 😄

Summary by CodeRabbit

  • Chores
    • Added Docker support with multi-stage builds for client and server (dev and prod images).
    • Added docker-compose to run frontend, backend, and MongoDB locally with health checks and persistent storage.
    • Configured .dockerignore to exclude node_modules to speed up image builds.
    • Frontend served via Nginx in production; backend images use production dependencies to reduce size.
    • Exposed standard development ports (frontend 3000, backend 5000, database 27017).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 6, 2025

Walkthrough

Adds Dockerization: multi-stage Dockerfiles for client and server, .dockerignore files ignoring node_modules, and a docker-compose stack defining MongoDB, backend-dev, and frontend-dev services with mounts, ports, a healthcheck, and a persistent volume.

Changes

Cohort / File(s) Summary of Changes
Client Dockerization
client/Dockerfile, client/.dockerignore
Adds multi-stage client Dockerfile (dev, build, prod with nginx) and .dockerignore ignoring node_modules; exposes ports 3000 (dev) and 80 (prod).
Server Dockerization
server/Dockerfile, server/.dockerignore
Adds multi-stage server Dockerfile (dev, prod) using node:20-alpine, installs deps appropriately, exposes port 5000; adds .dockerignore ignoring node_modules.
Compose Stack
docker-compose.yaml
Adds docker-compose.yaml with services: db (mongo:latest, mongo-data volume, healthcheck), backend-dev (build target dev, mounts, depends on db health), and frontend-dev (build target dev, mounts, depends on backend); maps ports 27017/5000/3000.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant U as User
    participant FE as Frontend (docker-compose: frontend-dev)
    participant BE as Backend (docker-compose: backend-dev)
    participant DB as MongoDB (docker-compose: db)
    rect rgba(220,240,255,0.16)
    note right of DB: Healthcheck: mongosh ping\n(`service_healthy` used by backend)
    DB-->>docker-compose: healthy
    end
    rect rgba(220,255,220,0.12)
    note over FE,BE: docker-compose startup order\nDB → backend-dev → frontend-dev
    docker-compose->>DB: start
    docker-compose->>BE: start (after DB healthy)
    docker-compose->>FE: start (after BE)
    end
    U->>FE: HTTP GET :3000
    FE->>BE: API request :5000
    BE->>DB: Query :27017
    DB-->>BE: Result
    BE-->>FE: JSON response
    FE-->>U: Rendered UI
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I hop through docks and compose a tune,
Images build beneath the moon,
Front calls back and data flows,
Volumes keep what memory knows.
node_modules left behind—hip hooray! 🐇🚢

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title mentions adding Docker configuration for the client and server and references .dockerignore, which aligns with key parts of the changeset; although it doesn’t call out the database or docker-compose setup, it still accurately describes a substantial portion of the PR’s purpose.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 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 b27fd2e and 064c1f8.

📒 Files selected for processing (1)
  • server/Dockerfile (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • server/Dockerfile

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c2c416 and 7ae2fe0.

📒 Files selected for processing (5)
  • client/.dockerignore (1 hunks)
  • client/Dockerfile (1 hunks)
  • docker-compose.yaml (1 hunks)
  • server/.dockerignore (1 hunks)
  • server/Dockerfile (1 hunks)

Comment thread server/Dockerfile Outdated
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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ae2fe0 and b27fd2e.

📒 Files selected for processing (1)
  • server/Dockerfile (1 hunks)

Comment thread server/Dockerfile
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Author

@YogeshVenugopal YogeshVenugopal left a comment

Choose a reason for hiding this comment

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

I have change the things in the docker files

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