Skip to content

Add Docker Compose configuration for API and platform services#79

Merged
Harish-Naruto merged 3 commits into
mainfrom
add/local-dev
Jun 24, 2026
Merged

Add Docker Compose configuration for API and platform services#79
Harish-Naruto merged 3 commits into
mainfrom
add/local-dev

Conversation

@Harish-Naruto

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

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added a new Docker Compose “master stack” to run all platforms together from one command.
    • Standardized port handling so services can be started side by side with fewer conflicts.
  • Documentation

    • Updated the Docker and README setup guides with the new stack, revised stack count, and example startup commands.
    • Expanded troubleshooting notes for port-in-use issues and host-port overrides.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Added a new docker/docker-compose.yml master stack for running the API, admin, member, and public frontend services together, and updated DOCKER.md and README.md to document it and the related port overrides.

Changes

Master Docker Compose stack

Layer / File(s) Summary
Compose scaffold and shared network
docker/docker-compose.yml
Adds the compose file header text and declares the shared coc-network bridge network.
API and public frontend services
docker/docker-compose.yml
Defines coc-api and callofcode-frontend with dev startup commands, health checks, and API URL wiring.
Admin backend and web services
docker/docker-compose.yml
Defines coc-admin-server and coc-admin-web with remapped ports, backend API settings, health checks, and service dependencies.
Member backend and web services
docker/docker-compose.yml
Defines coc-member-server and coc-member-web with remapped ports, backend API settings, health checks, and service dependencies.
Docker guide and README updates
DOCKER.md, README.md
Updates the Docker guide and README with the master stack count, run commands, service/port tables, and port-conflict overrides.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • call-0f-code/COC-API#78: Introduced the separate Docker Compose configurations that the new master stack now combines.

Suggested reviewers

  • callofcode07

Poem

A bunny hopped through ports at dawn,
Five Docker stacks now leap as one.
Healthchecks twinkled, neat and bright,
The master stack brought all to light.
🐰 Carrots up — the containers run!

🚥 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 a Docker Compose configuration for the API and platform services.
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 add/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: 3

🤖 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 103-105: The blockquote in the Docker docs contains an empty
quoted line that triggers MD028. Update the quoted text in the affected section
so the two quoted paragraphs are adjacent without a blank blockquote line,
keeping the content in the same place and preserving the existing wording in the
DOCKER.md section.
- Around line 250-257: The port override example is too generic for the
individual stacks and should be scoped to the compose file actually being used.
Update the documentation around the `PORT` example to make it clear that it only
works when running from the directory containing that compose file or when
paired with an explicit `-f`, and note that the nested platform stacks still
require changing into their folder or using a matching `-f` just like the
`docker compose` example near the stack instructions.

In `@docker/docker-compose.yml`:
- Around line 70-71: The docker-compose env_file entries point to missing local
env files, so update the references in docker-compose configuration to use the
existing .example files or add the corresponding .env.local.* files under
docker/. Check the env_file blocks for callofcode.in, coc-admin, and coc-member
so they resolve correctly relative to docker/docker-compose.yml and do not break
docker compose up.
🪄 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: 02387c71-ea5d-4e0c-9add-820416865500

📥 Commits

Reviewing files that changed from the base of the PR and between 5d5d9c3 and d4d3eb4.

📒 Files selected for processing (3)
  • DOCKER.md
  • README.md
  • docker/docker-compose.yml

Comment thread DOCKER.md
Comment on lines +103 to +105
> **Port remapping**: because `coc-admin` and `coc-member` both internally bind `8000` and `5173`, the master stack remaps them to unique host ports to avoid conflicts. Internal service-to-service communication (`API_URL=http://coc-api:3000`) still uses the original container ports.

> **Env files required**: make sure all six env files exist before starting (see [Environment Setup](#environment-setup) above).

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

Remove the blank line inside this blockquote.

That empty quoted line trips MD028 and will keep markdownlint failing.

🛠️ Suggested fix
 > **Port remapping**: because `coc-admin` and `coc-member` both internally bind `8000` and `5173`, the master stack remaps them to unique host ports to avoid conflicts. Internal service-to-service communication (`API_URL=http://coc-api:3000`) still uses the original container ports.
->
 > **Env files required**: make sure all six env files exist before starting (see [Environment Setup](`#environment-setup`) above).
📝 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
> **Port remapping**: because `coc-admin` and `coc-member` both internally bind `8000` and `5173`, the master stack remaps them to unique host ports to avoid conflicts. Internal service-to-service communication (`API_URL=http://coc-api:3000`) still uses the original container ports.
> **Env files required**: make sure all six env files exist before starting (see [Environment Setup](#environment-setup) above).
> **Port remapping**: because `coc-admin` and `coc-member` both internally bind `8000` and `5173`, the master stack remaps them to unique host ports to avoid conflicts. Internal service-to-service communication (`API_URL=http://coc-api:3000`) still uses the original container ports.
> **Env files required**: make sure all six env files exist before starting (see [Environment Setup](`#environment-setup`) above).
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 104-104: Blank line inside blockquote

(MD028, no-blanks-blockquote)

🤖 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 103 - 105, The blockquote in the Docker docs contains
an empty quoted line that triggers MD028. Update the quoted text in the affected
section so the two quoted paragraphs are adjacent without a blank blockquote
line, keeping the content in the same place and preserving the existing wording
in the DOCKER.md section.

Source: Linters/SAST tools

Comment thread DOCKER.md
Comment on lines +250 to +257
For the individual stacks, set a custom port via the `PORT` env variable:
```bash
PORT=3001 docker compose up
```
For the master stack, override the specific service port:
```bash
COC_API_PORT=3010 COC_ADMIN_BACKEND_PORT=8010 docker compose -f docker/docker-compose.yml up
```

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.

🎯 Functional Correctness | 🟡 Minor

Scope the port override example to the compose file being used. PORT=3001 docker compose up only applies when run from the directory containing that compose file, or with an explicit -f, so call out that the nested platform stacks still need cd into their folder or a matching -f.

🤖 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 250 - 257, The port override example is too generic
for the individual stacks and should be scoped to the compose file actually
being used. Update the documentation around the `PORT` example to make it clear
that it only works when running from the directory containing that compose file
or when paired with an explicit `-f`, and note that the nested platform stacks
still require changing into their folder or using a matching `-f` just like the
`docker compose` example near the stack instructions.

Comment thread docker/docker-compose.yml
Comment on lines +70 to +71
env_file:
- callofcode.in/.env.local.frontend

@coderabbitai coderabbitai Bot Jun 24, 2026

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.

🩺 Stability & Availability | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether the referenced env files exist relative to docker/
for f in \
  docker/callofcode.in/.env.local.frontend \
  docker/coc-admin/.env.local.backend \
  docker/coc-admin/.env.local.frontend \
  docker/coc-member/.env.local.backend \
  docker/coc-member/.env.local.frontend \
  .env.local ; do
  if [ -e "$f" ]; then echo "FOUND: $f"; else echo "MISSING: $f"; fi
done
# Also surface any similarly named env files anywhere in the repo
fd -H -t f '.env.local'

Repository: call-0f-code/COC-API

Length of output: 641


🏁 Script executed:

#!/bin/bash
set -e
git ls-files docker/docker-compose.yml docker/callofcode.in/.env.local.frontend.example docker/coc-admin/.env.local.backend.example docker/coc-admin/.env.local.frontend.example docker/coc-member/.env.local.backend.example docker/coc-member/.env.local.frontend.example
printf '\n--- docker-compose excerpts ---\n'
sed -n '60,180p' docker/docker-compose.yml
printf '\n--- all env_file refs ---\n'
rg -n "env_file:|- \.env|\.env\.local" docker/docker-compose.yml docker -g '!**/.git/**'

Repository: call-0f-code/COC-API

Length of output: 6780


🏁 Script executed:

#!/bin/bash
set -e
git ls-files docker/docker-compose.yml docker/callofcode.in/.env.local.frontend.example docker/coc-admin/.env.local.backend.example docker/coc-admin/.env.local.frontend.example docker/coc-member/.env.local.backend.example docker/coc-member/.env.local.frontend.example
printf '\n--- docker-compose excerpts ---\n'
sed -n '60,180p' docker/docker-compose.yml
printf '\n--- all env_file refs ---\n'
rg -n "env_file:|- \.env|\.env\.local" docker/docker-compose.yml docker -g '!**/.git/**'

Repository: call-0f-code/COC-API

Length of output: 6780


🏁 Script executed:

#!/bin/bash
set -e
git ls-files docker/docker-compose.yml docker/callofcode.in/.env.local.frontend.example docker/coc-admin/.env.local.backend.example docker/coc-admin/.env.local.frontend.example docker/coc-member/.env.local.backend.example docker/coc-member/.env.local.frontend.example
printf '\n--- docker-compose excerpts ---\n'
sed -n '60,180p' docker/docker-compose.yml
printf '\n--- all env_file refs ---\n'
rg -n "env_file:|- \.env|\.env\.local" docker/docker-compose.yml docker -g '!**/.git/**'

Repository: call-0f-code/COC-API

Length of output: 6780


Add the missing .env.local.* files or point to the .example files.
These env_file entries resolve relative to docker/docker-compose.yml, and only the matching .example files exist under docker/. docker compose up will fail unless docker/callofcode.in/.env.local.frontend, docker/coc-admin/.env.local.backend, docker/coc-admin/.env.local.frontend, docker/coc-member/.env.local.backend, and docker/coc-member/.env.local.frontend are created.

🤖 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/docker-compose.yml` around lines 70 - 71, The docker-compose env_file
entries point to missing local env files, so update the references in
docker-compose configuration to use the existing .example files or add the
corresponding .env.local.* files under docker/. Check the env_file blocks for
callofcode.in, coc-admin, and coc-member so they resolve correctly relative to
docker/docker-compose.yml and do not break docker compose up.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

us bro us

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.

@i-am-that-guy haha, fair enough! Just making sure no one on the team gets tripped up by a missing env file when spinning up the stack for the first time. 😄

Since those .env.local.* files are gitignored (as expected), it's worth either:

  1. Ensuring the .example counterparts (e.g., callofcode.in/.env.local.frontend.example) are up to date so devs know what to create, or
  2. Documenting the setup step in DOCKER.md — something like "Copy the .example files and fill in your values before running the master stack."

That way new contributors joining the team won't be left wondering why docker compose up fails immediately. Want me to open a follow-up issue to track this?

ʕ •ᴥ•ʔ

@Harish-Naruto Harish-Naruto merged commit 2ca2d11 into main Jun 24, 2026
4 checks passed
@Harish-Naruto Harish-Naruto deleted the add/local-dev branch June 24, 2026 19:23
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