feat: add dev container for zero-config local development#28915
feat: add dev container for zero-config local development#28915gfernandez-me wants to merge 4 commits into
Conversation
Adds a .devcontainer configuration so contributors can start coding without installing PostgreSQL or Redis locally. Works with VS Code Dev Containers and GitHub Codespaces.
|
Welcome to Cal.diy, @gfernandez-me! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1472242192
ℹ️ 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".
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughAdds a VS Code Dev Container configuration at 🚥 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)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a 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: 1
🧹 Nitpick comments (1)
.devcontainer/docker-compose.yml (1)
20-31: Make host port mappings configurable to reduce local collisions.Fixed host ports (
5450,6379) can fail on machines already using those ports. Consider env-driven defaults so users can override without editing committed files.Suggested compose refactor
ports: # Expose on 5450 to match DATABASE_URL in .env.example - - "5450:5432" + - "${DEVCONTAINER_POSTGRES_PORT:-5450}:5432" @@ ports: - - "6379:6379" + - "${DEVCONTAINER_REDIS_PORT:-6379}:6379"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.devcontainer/docker-compose.yml around lines 20 - 31, Change the hard-coded host port mappings for the postgres and redis services to use environment-driven defaults so local port collisions can be avoided; replace the literal mappings ("5450:5432" and "6379:6379") with env variable expansions like ${POSTGRES_HOST_PORT:-5450}:5432 and ${REDIS_HOST_PORT:-6379}:6379 in the docker-compose service definitions (postgres, redis) and update .env.example to include POSTGRES_HOST_PORT and REDIS_HOST_PORT with the default values and a short comment about overriding them.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Around line 215-216: Update the README sentence that currently references
`DATABASE_URL` and `REDIS_URL` to also mention `DATABASE_DIRECT_URL`;
specifically, amend the line "> The `DATABASE_URL` and `REDIS_URL` are
pre-configured by the Dev Container and do not need to be changed." to include
`DATABASE_DIRECT_URL` so it reads something like "The `DATABASE_URL`,
`DATABASE_DIRECT_URL`, and `REDIS_URL` are pre-configured by the Dev Container
and do not need to be changed." This ensures Prisma flows that rely on
`DATABASE_DIRECT_URL` are documented.
---
Nitpick comments:
In @.devcontainer/docker-compose.yml:
- Around line 20-31: Change the hard-coded host port mappings for the postgres
and redis services to use environment-driven defaults so local port collisions
can be avoided; replace the literal mappings ("5450:5432" and "6379:6379") with
env variable expansions like ${POSTGRES_HOST_PORT:-5450}:5432 and
${REDIS_HOST_PORT:-6379}:6379 in the docker-compose service definitions
(postgres, redis) and update .env.example to include POSTGRES_HOST_PORT and
REDIS_HOST_PORT with the default values and a short comment about overriding
them.
🪄 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: CHILL
Plan: Pro
Run ID: ef6c9d37-0c6c-439e-857f-2a148bb04ded
📒 Files selected for processing (3)
.devcontainer/devcontainer.json.devcontainer/docker-compose.ymlREADME.md
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
|
Hi, README states Redis is exposed on host port 6379, but the devcontainer docker-compose does not publish Redis ports, so host tools cannot connect to Redis as documented. Severity: action required | Category: correctness How to fix: Expose Redis or update README Agent prompt to fix - you can give this to your LLM of choice:
Found by Qodo. Free code review for open-source maintainers. |
|
Hi, The devcontainer Postgres uses password Severity: remediation recommended | Category: correctness How to fix: Align Postgres creds and docs Agent prompt to fix - you can give this to your LLM of choice:
Found by Qodo code review |
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
* Updated DATABASE_URL and DATABASE_DIRECT_URL in .env.example to include the password. * Enhanced README.md to specify PostgreSQL credentials for host access. * Added port exposure for Redis in docker-compose.yml for easier access.
|
requested fixes done. |
What does this PR do?
Adds a
.devcontainerconfiguration so contributors can spin up a fully working development environment without installing PostgreSQL or Redis locally. Works with VS Code Dev Containers and GitHub Codespaces.Changes:
.devcontainer/devcontainer.json— Node.js 20 dev environment; pre-setsDATABASE_URL,DATABASE_DIRECT_URL, andREDIS_URLviaremoteEnvso contributors never need to touch those values; auto-copies.env.example→.envon first container start (skipped if.envalready exists); installs dependencies viayarn install.devcontainer/docker-compose.yml— Postgres 15-alpine exposed on port5450(matching the default in.env.example) and Redis 7-alpine on6379README.md— adds a "Dev Container setup" section under Development with step-by-step instructionsThe only manual step after the container starts is setting
NEXTAUTH_SECRETandCALENDSO_ENCRYPTION_KEYin.env.Visual Demo (For contributors especially)
N/A — infrastructure configuration, no UI changes.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Dev Containers: Reopen in Containerfrom the Command Palette).postCreateCommandto finish —.envshould be created andyarn installshould complete..envand fill inNEXTAUTH_SECRET(openssl rand -base64 32) andCALENDSO_ENCRYPTION_KEY(openssl rand -base64 24).yarn workspace @calcom/prisma db-migrate.yarn devand confirm the app starts at http://localhost:3000.Checklist