Skip to content

Add Docker Compose configurations for full stack development#78

Merged
Harish-Naruto merged 1 commit into
mainfrom
complete/local-dev
Jun 24, 2026
Merged

Add Docker Compose configurations for full stack development#78
Harish-Naruto merged 1 commit into
mainfrom
complete/local-dev

Conversation

@Harish-Naruto

@Harish-Naruto Harish-Naruto commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Documentation

    • Added a new Docker local development guide with setup, startup, troubleshooting, and common commands.
    • Updated the README to reflect the new Docker-based workflow and revised environment setup steps.
  • New Features

    • Added Docker Compose setups for the Member, Admin, and website environments with clearer service startup ordering and local URLs.
    • Added example environment files for frontend and backend local configuration.
  • Chores

    • Updated ignore rules to keep a local example environment file available.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds three Docker Compose stacks under docker/ for coc-member, coc-admin, and callofcode.in platforms, each with environment example files. The root docker-compose.yml gains develop.watch hot-reload rules and drops the explicit container_name. .gitignore is updated to track .env.local.*.example files. README.md and a new DOCKER.md are rewritten to document the Docker-first workflow.

Changes

Docker Local Development Setup

Layer / File(s) Summary
Root compose watch rules and .gitignore exception
.gitignore, docker-compose.yml
Adds a .gitignore exception for *.example env files, removes container_name from the api service, and adds develop.watch rules to sync ./src live and rebuild on package.json, bun.lock, or prisma/ changes.
coc-member Docker Compose stack and env examples
docker/coc-member/docker-compose.yml, docker/coc-member/.env.local.backend.example, docker/coc-member/.env.local.frontend.example
Defines a three-service stack (coc-api, server, web) with health-gated startup ordering, Prisma generate + migrate on coc-api startup, and env example files for backend (JWT, rate-limiting, email, CORS) and frontend (VITE_API_URL).
coc-admin Docker Compose stack and env examples
docker/coc-admin/docker-compose.yml, docker/coc-admin/.env.local.backend.example, docker/coc-admin/.env.local.frontend.example
Mirrors the coc-member stack pattern for the admin platform, adding backend env variables for community links (WHATSAPP_LINK, DISCORD_LINK) and a VITE_GIF_URL in the frontend example.
callofcode.in Docker Compose stack and env example
docker/callofcode.in/docker-compose.yml, docker/callofcode.in/.env.local.frontend.example
Defines a two-service stack (coc-api + frontend on port 3001) using callofcode07/callofcode:latest, with API_BASE_URL wired to coc-api and an optional GITHUB_TOKEN in the frontend env example.
README and DOCKER.md documentation
README.md, DOCKER.md
Rewrites README prerequisites and Getting Started steps to be Docker-first, updates the folder structure diagram to include docker/, removes the bun run local seeding flow. Adds a full DOCKER.md covering all four stacks, env setup, health-check ordering, watch behavior, Dockerfile stages, and troubleshooting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 Hippity hop, a new Docker fleet,
Three stacks in docker/ make dev complete!
Health checks cascade, services awake,
Prisma migrates before the first request's sake.
.env.local.*.example tracked with glee —
No secrets committed, just placeholders free! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding Docker Compose setups for full-stack local development.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch complete/local-dev

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (4)
docker/coc-admin/docker-compose.yml (1)

37-38: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

pull_policy: missing with :latest can pin stale images.

With pull_policy: missing, once an image exists locally it is never re-pulled, so :latest tag updates published upstream won't be picked up until the local image is removed. For a dev stack that's usually acceptable, but document the manual docker compose pull step (or use pull_policy: always) so contributors don't run outdated backend/frontend builds.

Also applies to: 60-61

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/coc-admin/docker-compose.yml` around lines 37 - 38, The docker-compose
service for the backend and related services is using latest-tagged images with
pull_policy: missing, which can leave contributors running stale builds. Update
the compose configuration for the affected image entries so they either use
pull_policy: always or add clear guidance in the repo docs to run docker compose
pull before starting the stack. Use the image and pull_policy settings in
docker-compose.yml to locate the affected services.
docker-compose.yml (1)

16-38: 🚀 Performance & Scalability | 🔵 Trivial

Remove the redundant sync rule and refresh dependency volumes on rebuilds.

  • - .:/app already live-mounts ./src, so the develop.watch sync is redundant.
  • action: rebuild on package.json/bun.lock recreates the container, but the anonymous /app/node_modules and /app/node_modules/.prisma volumes can be reused, so new deps may stay hidden until those volumes are renewed or removed.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker-compose.yml` around lines 16 - 38, The compose setup has a redundant
`develop.watch` sync for `./src` because the `.:/app` bind mount already covers
it, and rebuild triggers in `docker-compose.yml` do not refresh the anonymous
`/app/node_modules` and `/app/node_modules/.prisma` volumes. Remove the `sync`
rule from the `develop.watch` block, and update the rebuild flow tied to
`package.json`, `bun.lock`, and the Prisma schema so dependency volumes are
recreated or cleared when the container rebuilds, using the existing `command`
and `develop.watch` configuration as the place to make the change.
docker/callofcode.in/docker-compose.yml (1)

37-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the frontend image to an immutable reference.

Line 37 uses :latest; pin to a fixed tag or digest to keep local dev runs deterministic.

Suggested change
-    image: callofcode07/callofcode:latest
+    image: callofcode07/callofcode@sha256:<digest>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/callofcode.in/docker-compose.yml` around lines 37 - 38, The frontend
service image is using a mutable latest tag, which makes runs non-deterministic.
Update the image reference in the compose config to use a fixed version tag or,
preferably, a digest instead of callofcode07/callofcode:latest. Keep the change
in the same service definition so the frontend container remains pinned to an
immutable reference.
docker/coc-member/docker-compose.yml (1)

37-38: 📐 Maintainability & Code Quality | 🔵 Trivial

Pin the service images instead of using :latest. Lines 37 and 60 use mutable tags; switching both callofcode07/coc-member-backend and callofcode07/coc-member-frontend to immutable digests would avoid drift in local stack behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/coc-member/docker-compose.yml` around lines 37 - 38, The backend and
frontend service images in docker-compose are using mutable :latest tags, which
can drift over time. Update the image references for both the
callofcode07/coc-member-backend and callofcode07/coc-member-frontend services to
immutable digests instead of tags, keeping the existing service definitions
intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@DOCKER.md`:
- Around line 145-147: The fenced diagram block in DOCKER.md is missing a
language tag, causing the markdown lint issue. Update the untyped fenced block
that contains the coc-api → server/backend → web/frontend flow to use a text
language label, and keep the content unchanged so the block remains readable and
lint-compliant.

In `@docker/coc-member/.env.local.backend.example`:
- Line 27: The example env file currently hardcodes a personal-looking contact
address, so replace the CONTACT_EMAIL_ID value with a generic placeholder in the
.env.local.backend.example template. Update the committed example to use neutral
sample data only, keeping the field name intact so it still documents the
expected setting.

---

Nitpick comments:
In `@docker-compose.yml`:
- Around line 16-38: The compose setup has a redundant `develop.watch` sync for
`./src` because the `.:/app` bind mount already covers it, and rebuild triggers
in `docker-compose.yml` do not refresh the anonymous `/app/node_modules` and
`/app/node_modules/.prisma` volumes. Remove the `sync` rule from the
`develop.watch` block, and update the rebuild flow tied to `package.json`,
`bun.lock`, and the Prisma schema so dependency volumes are recreated or cleared
when the container rebuilds, using the existing `command` and `develop.watch`
configuration as the place to make the change.

In `@docker/callofcode.in/docker-compose.yml`:
- Around line 37-38: The frontend service image is using a mutable latest tag,
which makes runs non-deterministic. Update the image reference in the compose
config to use a fixed version tag or, preferably, a digest instead of
callofcode07/callofcode:latest. Keep the change in the same service definition
so the frontend container remains pinned to an immutable reference.

In `@docker/coc-admin/docker-compose.yml`:
- Around line 37-38: The docker-compose service for the backend and related
services is using latest-tagged images with pull_policy: missing, which can
leave contributors running stale builds. Update the compose configuration for
the affected image entries so they either use pull_policy: always or add clear
guidance in the repo docs to run docker compose pull before starting the stack.
Use the image and pull_policy settings in docker-compose.yml to locate the
affected services.

In `@docker/coc-member/docker-compose.yml`:
- Around line 37-38: The backend and frontend service images in docker-compose
are using mutable :latest tags, which can drift over time. Update the image
references for both the callofcode07/coc-member-backend and
callofcode07/coc-member-frontend services to immutable digests instead of tags,
keeping the existing service definitions intact.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9b04695a-9560-499d-93c1-371a4f723a7a

📥 Commits

Reviewing files that changed from the base of the PR and between cec5ef4 and 30814e6.

📒 Files selected for processing (12)
  • .gitignore
  • DOCKER.md
  • README.md
  • docker-compose.yml
  • docker/callofcode.in/.env.local.frontend.example
  • docker/callofcode.in/docker-compose.yml
  • docker/coc-admin/.env.local.backend.example
  • docker/coc-admin/.env.local.frontend.example
  • docker/coc-admin/docker-compose.yml
  • docker/coc-member/.env.local.backend.example
  • docker/coc-member/.env.local.frontend.example
  • docker/coc-member/docker-compose.yml

Comment thread DOCKER.md
Comment on lines +145 to +147
```
coc-api (healthy) → server/backend (healthy) → web/frontend
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a language to the fenced code block.

Line 145 uses an untyped fenced block, which triggers MD040 and can break markdown lint in CI.

Proposed fix
-```
+```text
 coc-api (healthy) → server/backend (healthy) → web/frontend
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 145-145: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@DOCKER.md` around lines 145 - 147, The fenced diagram block in DOCKER.md is
missing a language tag, causing the markdown lint issue. Update the untyped
fenced block that contains the coc-api → server/backend → web/frontend flow to
use a text language label, and keep the content unchanged so the block remains
readable and lint-compliant.

Source: Linters/SAST tools


# Email service (Resend)
EMAIL_ID=your_sender@example.com
CONTACT_EMAIL_ID=callofcode07@gmail.com

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Replace real email with a neutral placeholder.

Line 27 hardcodes a personal-looking email in a committed example file. Use a generic placeholder to avoid storing direct identifiers in repo history.

Suggested change
-CONTACT_EMAIL_ID=callofcode07@gmail.com
+CONTACT_EMAIL_ID=contact@example.com
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
CONTACT_EMAIL_ID=callofcode07@gmail.com
CONTACT_EMAIL_ID=contact@example.com
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 27-27: [UnorderedKey] The CONTACT_EMAIL_ID key should go before the EMAIL_ID key

(UnorderedKey)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/coc-member/.env.local.backend.example` at line 27, The example env
file currently hardcodes a personal-looking contact address, so replace the
CONTACT_EMAIL_ID value with a generic placeholder in the
.env.local.backend.example template. Update the committed example to use neutral
sample data only, keeping the field name intact so it still documents the
expected setting.

@Harish-Naruto Harish-Naruto merged commit 5d5d9c3 into main Jun 24, 2026
4 checks passed
@Harish-Naruto Harish-Naruto deleted the complete/local-dev branch June 24, 2026 13:48
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.

2 participants