docker_compose#1773
Conversation
WalkthroughThis PR introduces a root-level ChangesDocker Compose Configuration and Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 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.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR introduces a root-level docker-compose.yml file for local development and updates the documentation (README and docs index) to reference it instead of duplicating compose snippets that users had to copy.
Changes:
- Add a new
docker-compose.ymlat the repo root with dev-oriented defaults (port 3001,ryot-dev-dbcontainer, hardcoded admin token). - Update
README.mdQuick Start to point to the new compose file and reflect new values. - Update
apps/docs/src/index.mdinstallation snippet to mirror the new compose file.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| docker-compose.yml | New root compose file for local/dev use with Postgres and Ryot services. |
| README.md | Quick Start updated to reference the new compose file, new port, and updated env vars. |
| apps/docs/src/index.md | Installation docs updated to align with the new compose file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| environment: | ||
| - SERVER_ADMIN_ACCESS_TOKEN=CHANGE_ME_TO_A_LONG_RANDOM_STRING | ||
| - DATABASE_URL=postgres://postgres:postgres@ryot-db:5432/postgres | ||
| SERVER_ADMIN_ACCESS_TOKEN: mysecretkey |
| ports: | ||
| - "3001:8000" | ||
| environment: | ||
| SERVER_ADMIN_ACCESS_TOKEN: mysecretkey |
| services: | ||
| ryot-db: | ||
| image: postgres:18-alpine # at-least version 15 is required | ||
| image: postgres:18-alpine |
| ryot-db: | ||
| image: postgres:18-alpine | ||
| restart: unless-stopped | ||
| container_name: ryot-dev-db |
| ## Quick Start | ||
|
|
||
| Create a `docker-compose.yml` file: | ||
| Use the `docker-compose.yml` file from the root of this repository: |
| POSTGRES_USER: postgres | ||
| POSTGRES_DB: postgres | ||
| volumes: | ||
| - postgres_storage:/var/lib/postgresql |
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-compose.yml`:
- Line 11: The volume mount currently maps the host volume to the parent path
/var/lib/postgresql; change the target to the actual PGDATA directory
/var/lib/postgresql/data so Postgres persists its database files across
recreates—update the postgres service volume mapping (the line that currently
reads the mapping to /var/lib/postgresql) to use /var/lib/postgresql/data as the
container path.
- Around line 22-24: Replace the committed secrets and inline DB credentials by
using environment variable substitution for SERVER_ADMIN_ACCESS_TOKEN and
DATABASE_URL (and FRONTEND_URL if intended to be configurable) instead of
hardcoded values; update the docker-compose service entries that currently
assign SERVER_ADMIN_ACCESS_TOKEN: mysecretkey and DATABASE_URL: postgres://...
to use ${SERVER_ADMIN_ACCESS_TOKEN} and ${DATABASE_URL} (or
${SERVER_ADMIN_ACCESS_TOKEN:?} / ${DATABASE_URL:?} to enforce presence), and add
a .env.example documenting these variables so users must provide real secrets
rather than copy-pasting defaults.
In `@README.md`:
- Around line 42-72: The README's Quick Start currently duplicates the root
docker-compose.yml contents; replace the inline YAML block with a concise
instruction that tells users to run the docker-compose command (e.g., "Use the
root docker-compose.yml: docker compose -f <path> up") and add a relative link
to the repository's docker-compose.yml file; update the Quick Start section text
to reference "docker-compose.yml" and the link instead of embedding the YAML so
the docs no longer drift from the source config.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: bdd58e3d-80eb-4068-a840-546e64e9ee9d
📒 Files selected for processing (3)
README.mdapps/docs/src/index.mddocker-compose.yml
| POSTGRES_USER: postgres | ||
| POSTGRES_DB: postgres | ||
| volumes: | ||
| - postgres_storage:/var/lib/postgresql |
There was a problem hiding this comment.
Mount the PostgreSQL data directory, not its parent path.
Line 11 should target /var/lib/postgresql/data to reliably persist the actual PGDATA directory across container recreations.
Proposed fix
- - postgres_storage:/var/lib/postgresql
+ - postgres_storage:/var/lib/postgresql/data📝 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.
| - postgres_storage:/var/lib/postgresql | |
| - postgres_storage:/var/lib/postgresql/data |
🤖 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` at line 11, The volume mount currently maps the host
volume to the parent path /var/lib/postgresql; change the target to the actual
PGDATA directory /var/lib/postgresql/data so Postgres persists its database
files across recreates—update the postgres service volume mapping (the line that
currently reads the mapping to /var/lib/postgresql) to use
/var/lib/postgresql/data as the container path.
| SERVER_ADMIN_ACCESS_TOKEN: mysecretkey | ||
| DATABASE_URL: postgres://postgres:postgres@ryot-dev-db:5432/postgres | ||
| FRONTEND_URL: http://localhost:3001 |
There was a problem hiding this comment.
Avoid committed default secrets and inline DB credentials in Compose defaults.
Committing SERVER_ADMIN_ACCESS_TOKEN: mysecretkey and embedding DB creds in DATABASE_URL creates an insecure copy-paste baseline. Use env substitution with required vars (or .env.example) so users must set real secrets.
Proposed fix
environment:
- SERVER_ADMIN_ACCESS_TOKEN: mysecretkey
- DATABASE_URL: postgres://postgres:postgres@ryot-dev-db:5432/postgres
+ SERVER_ADMIN_ACCESS_TOKEN: ${SERVER_ADMIN_ACCESS_TOKEN:?set_in_.env}
+ DATABASE_URL: postgres://${POSTGRES_USER:?set}:${POSTGRES_PASSWORD:?set}`@ryot-dev-db`:5432/${POSTGRES_DB:-postgres}
FRONTEND_URL: http://localhost:3001📝 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.
| SERVER_ADMIN_ACCESS_TOKEN: mysecretkey | |
| DATABASE_URL: postgres://postgres:postgres@ryot-dev-db:5432/postgres | |
| FRONTEND_URL: http://localhost:3001 | |
| environment: | |
| SERVER_ADMIN_ACCESS_TOKEN: ${SERVER_ADMIN_ACCESS_TOKEN:?set_in_.env} | |
| DATABASE_URL: postgres://${POSTGRES_USER:?set}:${POSTGRES_PASSWORD:?set}`@ryot-dev-db`:5432/${POSTGRES_DB:-postgres} | |
| FRONTEND_URL: http://localhost:3001 |
🧰 Tools
🪛 Checkov (3.2.529)
[medium] 23-24: Basic Auth Credentials
(CKV_SECRET_4)
🤖 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 22 - 24, Replace the committed secrets and
inline DB credentials by using environment variable substitution for
SERVER_ADMIN_ACCESS_TOKEN and DATABASE_URL (and FRONTEND_URL if intended to be
configurable) instead of hardcoded values; update the docker-compose service
entries that currently assign SERVER_ADMIN_ACCESS_TOKEN: mysecretkey and
DATABASE_URL: postgres://... to use ${SERVER_ADMIN_ACCESS_TOKEN} and
${DATABASE_URL} (or ${SERVER_ADMIN_ACCESS_TOKEN:?} / ${DATABASE_URL:?} to
enforce presence), and add a .env.example documenting these variables so users
must provide real secrets rather than copy-pasting defaults.
| Use the `docker-compose.yml` file from the root of this repository: | ||
|
|
||
| ```yaml | ||
| services: | ||
| ryot-db: | ||
| restart: unless-stopped | ||
| image: postgres:18-alpine | ||
| restart: unless-stopped | ||
| container_name: ryot-dev-db | ||
| environment: | ||
| - POSTGRES_PASSWORD=postgres | ||
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_DB: postgres | ||
| volumes: | ||
| - postgres_storage:/var/lib/postgresql | ||
|
|
||
| ryot: | ||
| image: ignisda/ryot:v10 | ||
| restart: unless-stopped | ||
| container_name: ryot | ||
| depends_on: | ||
| - ryot-db | ||
| ports: | ||
| - "8000:8000" | ||
| - "3001:8000" | ||
| environment: | ||
| - SERVER_ADMIN_ACCESS_TOKEN=CHANGE_ME_TO_A_LONG_RANDOM_STRING | ||
| - DATABASE_URL=postgres://postgres:postgres@ryot-db:5432/postgres | ||
| SERVER_ADMIN_ACCESS_TOKEN: mysecretkey | ||
| DATABASE_URL: postgres://postgres:postgres@ryot-dev-db:5432/postgres | ||
| FRONTEND_URL: http://localhost:3001 | ||
|
|
||
| volumes: | ||
| postgres_storage: | ||
| ``` |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
Quick Start duplicates the root Compose config and can drift.
Since this section already instructs users to use the root docker-compose.yml, consider replacing the inline YAML with a short command + link to the file path to keep docs and runtime config in lockstep.
🤖 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 `@README.md` around lines 42 - 72, The README's Quick Start currently
duplicates the root docker-compose.yml contents; replace the inline YAML block
with a concise instruction that tells users to run the docker-compose command
(e.g., "Use the root docker-compose.yml: docker compose -f <path> up") and add a
relative link to the repository's docker-compose.yml file; update the Quick
Start section text to reference "docker-compose.yml" and the link instead of
embedding the YAML so the docs no longer drift from the source config.
|
Why are these changes needed? |
|
Went through the PR again. I don't see any reason for these changes. I will close this PR. Feel free to ping me here if you have any reasons for this PR to be merged. |
Aligned Docker Compose config across repo + docs" --body "This PR makes the Docker Compose configuration consistent across the repo compose file, README Quick Start, and docs installation page.\n\nChanges:\n- Updates docker-compose.yml to match the documented setup\n- Updates README Quick Start snippet\n- Updates docs installation snippet and replaces hard-coded admin token with a placeholder\n\nHow to test:\n- docker compose up -d\n- Visit
Summary by CodeRabbit