feat: Docker Compose one-click demo environment for Mega / Orion (#1792)#1823
Conversation
Add one-click demo stack: - docker-compose.demo.yml (+ .env.example, init-db.sh) - docs guide - minor Orion server tweaks Signed-off-by: Hongze Gao <15101764808@163.com>
Signed-off-by: Hongze Gao <15101764808@163.com>
|
@codex review |
|
Claude finished @genedna's task in 1m 44s —— View job Code Review CompleteI've performed a comprehensive review of this Docker Compose demo environment PR. Overall, this is a well-structured implementation that successfully provides a one-click demo environment. Below are my findings organized by category. SummaryStrengths:
Areas for Improvement:
Detailed Findings1. Security IssuesCritical:
Important:
2. Docker Compose ConfigurationGood Practices Observed:
Issues:
3. Shell Script Issues
4. Configuration File Issues
5. Rust Code Changes
6. Documentation Quality
Strengths:
Issues:
7. Best Practices & ArchitecturePositive:
Suggestions:
Testing RecommendationsSince I cannot run the actual stack, I recommend testing:
Priority RecommendationsHigh Priority:
Medium Priority: Low Priority: ConclusionThis is a solid implementation of a Docker Compose demo environment. The core functionality is well-designed with proper dependency management and health checking. The main concerns are around security hardening (expected for a demo) and documentation completeness. Addressing the high-priority recommendations will significantly improve the security posture even for demo use. The PR successfully achieves its goals of providing a one-click demo environment and serves as a good foundation for local development and testing. Tasks
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive Docker Compose-based demo environment that orchestrates the entire Mega/Orion stack (Mega backend, Mega UI, Orion Server, Orion Build Client, and Campsite API) along with all required infrastructure services (PostgreSQL, MySQL, Redis, RustFS). The implementation aims to provide a one-click local development and demonstration setup with proper health checks and dependency management.
Changes:
- Added complete Docker Compose stack configuration with 8 services and proper health checks
- Implemented health check endpoint for Orion Server at
/v2/health - Enhanced Orion Server Dockerfile with improved build reliability and curl for health checks
- Created comprehensive documentation guide with troubleshooting and architecture overview
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| docker/demo/docker-compose.demo.yml | Main orchestration file defining 8 services with health checks, volume mounts, and environment configuration |
| docker/demo/.env.example | Template configuration file with database credentials, service URLs, and feature flags |
| docker/demo/init-db.sh | PostgreSQL initialization script (informational only, actual DB creation handled by POSTGRES_DB env var) |
| docs/demo/docker-compose-guide-for-mega-and-orion-demo-setup.md | Comprehensive 511-line guide covering prerequisites, setup, troubleshooting, and architecture |
| orion-server/Dockerfile | Enhanced with Cargo retry configuration, English comments, and curl installation for health checks |
| orion-server/src/api.rs | Added /v2/health endpoint with database connectivity check |
| orion-server/src/server.rs | Registered health check handler in API routes |
docs/demo/docker-compose-guide-for-mega-and-orion-demo-setup.md
Outdated
Show resolved
Hide resolved
docs/demo/docker-compose-guide-for-mega-and-orion-demo-setup.md
Outdated
Show resolved
Hide resolved
|
|
||
| ## Stopping and Cleanup | ||
|
|
||
| ### Stop services |
There was a problem hiding this comment.
Typo in the command comment. The line reads "Stop the stack:h" with an extra "h" at the end. This should be removed for consistency with other section headers.
| ### Stop services | |
| ### Stop the stack |
docs/demo/docker-compose-guide-for-mega-and-orion-demo-setup.md
Outdated
Show resolved
Hide resolved
docs/demo/docker-compose-guide-for-mega-and-orion-demo-setup.md
Outdated
Show resolved
Hide resolved
docs/demo/docker-compose-guide-for-mega-and-orion-demo-setup.md
Outdated
Show resolved
Hide resolved
| environment: | ||
| POSTGRES_USER: ${POSTGRES_USER:-postgres} | ||
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} | ||
| # Main DB is primarily used by mono; orion will be created by init script |
There was a problem hiding this comment.
Misleading comment about orion database creation. The comment states "orion will be created by init script" but the init-db.sh script does not create any orion database - it only prints informational messages. The comment should be updated to reflect that orion-server uses the same mono database, as correctly noted in line 21 of the init-db.sh script and elsewhere in the configuration.
| # Main DB is primarily used by mono; orion will be created by init script | |
| # Main DB is primarily used by mono; orion-server shares the same mono database |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4eee9006a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Run migrations by default; allow disabling for debugging via CAMPSITE_RUN_MIGRATIONS=0 | ||
| # Use $$ to avoid docker compose substituting the variable at parse time. | ||
| if [ "$${CAMPSITE_RUN_MIGRATIONS:-1}" = "1" ]; then | ||
| bin/rails db:migrate |
There was a problem hiding this comment.
Pass CAMPSITE_RUN_MIGRATIONS into container env
The entrypoint script checks CAMPSITE_RUN_MIGRATIONS, but the service environment never defines that variable (Compose only uses .env for interpolation unless you map it into environment or env_file). This means CAMPSITE_RUN_MIGRATIONS=0 in docker/demo/.env will never reach the container, so migrations always run on every start. If you want the documented toggle to work, add CAMPSITE_RUN_MIGRATIONS to the service environment or include an env_file.
Useful? React with 👍 / 👎.
|
正在根据review进行代码修改 |
…dation#1792) Review feedback addressed: - Remove unused init-db.sh mount and delete placeholder script - Orion /v2/health now hides database error details - Add docker/demo/.env to .gitignore to prevent secret leakage - Add .dockerignore to reduce build context size - docker-compose.demo.yml: • pass CAMPSITE_RUN_MIGRATIONS to campsite_api • add sample resource limits to postgres - Docs: fix FAQ anchor, replace full-width punctuation, add hardware requirements and MySQL low-privilege note. Signed-off-by: Hongze Gao <15101764808@163.com>
Code Review Reply已完成修复,以下逐条回应review建议并说明当前状态。 1 安全相关
2 Docker Compose 配置
3 Shell 脚本
4 代码修改
5 文档修复
6 其他补充
未满足项与原因
|
944cf39
Summary
Related issue: #1792
This PR introduces a full Docker Compose stack that boots Mega, Orion, Campsite and all required infrastructure with a single command.
It streamlines local onboarding, showcases end-to-end functionality, and serves as a reproducible baseline for E2E tests or live demos.
Key Changes
docker/demo/docker-compose.demo.yml:depends_on+healthcheckto guarantee deterministic startup.docker/demo/.env.example:docker/demo/init-db.sh:monoandorionschemas on first Postgres start-up.docs/demo/docker-compose-guide-for-mega-and-orion-demo-setup.md:orion-server/Dockerfile:BUILD_LOG_DIRwith demo volume.orion-server/src/api.rs:prelude::DateTimeUtc) with local additions (QuerySelect) to resolve compile conflict.orion-server/src/server.rs:Motivation
Usage
cp docker/demo/.env.example docker/demo/.env
2. Launch all services:
docker compose -f docker/demo/docker-compose.demo.yml up -d
3. Access Entry Points:
http://localhost:3000http://localhost:8000http://localhost:8004/v2/healthhttp://localhost:9001**Stop the stack:**h
docker compose -f docker/demo/docker-compose.demo.yml down
Notes
MEGA_*_IMAGEenv vars > public ECR images.Checklist
git commit -s -S)