Add Docker Compose configuration for API and platform services#79
Conversation
📝 WalkthroughWalkthroughAdded a new ChangesMaster Docker Compose stack
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
DOCKER.mdREADME.mddocker/docker-compose.yml
| > **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). |
There was a problem hiding this comment.
📐 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.
| > **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
| 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 | ||
| ``` |
There was a problem hiding this comment.
🎯 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.
| env_file: | ||
| - callofcode.in/.env.local.frontend |
There was a problem hiding this comment.
🩺 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.
There was a problem hiding this comment.
@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:
- Ensuring the
.examplecounterparts (e.g.,callofcode.in/.env.local.frontend.example) are up to date so devs know what to create, or - Documenting the setup step in
DOCKER.md— something like "Copy the.examplefiles 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?
ʕ •ᴥ•ʔ
Summary by CodeRabbit
New Features
Documentation