Skip to content

Add dev & production deployment setup#93

Open
mguptahub wants to merge 13 commits intomainfrom
infra/add-docker-compose-dev
Open

Add dev & production deployment setup#93
mguptahub wants to merge 13 commits intomainfrom
infra/add-docker-compose-dev

Conversation

@mguptahub
Copy link
Copy Markdown
Collaborator

@mguptahub mguptahub commented Mar 24, 2026

Summary

  • docker-compose.yml (root): dev setup — builds from source, mounts plane_mcp/ for live code changes, Valkey for token storage (no exposed port)
  • deployments/docker-compose.yaml: production setup using published image, Valkey with persistent volume
  • deployments/variables.env: production env template
  • deployments/README.md: full deployment docs covering Docker Compose and Helm chart (via helm.plane.so)
  • README.md: added Self-Hosting and Local Development sections
  • Dockerfile: fixed uv install — replaced COPY --from=ghcr.io/astral-sh/uv with pip install uv to avoid GHCR auth failures

Test plan

  • cp .env.docker .envdocker compose up --build starts cleanly
  • Server reachable at http://localhost:8211/http/api-key/mcp
  • Code changes in plane_mcp/ picked up after docker compose restart mcp
  • cd deployments && docker compose up -d works with a valid variables.env
  • Helm install steps verified against chart in plane-helm-charts

Co-authored with Plane-Ai noreply@plane.so

Summary by CodeRabbit

  • New Features

    • Added Docker Compose deployments for production and local development (service orchestration and live code reloading).
  • Documentation

    • Expanded README with "Self-Hosting" and "Local Development" guides.
    • Added deployments docs covering Docker Compose, Helm, endpoints, variables, and troubleshooting.
  • Chores

    • Added environment templates and a production variables file; updated .gitignore for local envs.
    • Simplified Docker image dependency installation.

mguptahub and others added 11 commits March 24, 2026 17:16
Adds a dev-focused Docker Compose setup with:
- mcp service: builds from local Dockerfile, mounts source for editable
  install so code changes take effect on container restart without rebuild
- redis service: Redis 7 alpine for OAuth token storage
- .env.docker template with all required environment variables
- .env.docker.local added to .gitignore for local secret overrides

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- deploy/docker-compose.yaml: production setup using published image (no build),
  with Redis volume for persistent token storage
- deploy/variables.env: production env template with all required variables
- README: add Self-Hosting and Local Development sections covering Docker
  Compose, standalone uv setup, tests, and linting
- .gitignore: ignore deploy/variables.env.local for local secret overrides

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch to valkey/valkey:8-alpine in dev and prod compose files
- Remove exposed port for Valkey in both (internal only)
- Update README troubleshooting and services table accordingly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
COPY --from=ghcr.io/astral-sh/uv:latest fails when GHCR is inaccessible.
Switch to pip install uv which works without registry auth.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If PLANE_OAUTH_PROVIDER_CLIENT_ID / CLIENT_SECRET are not set, the server
now starts successfully with only the header API-key endpoint available.
OAuth and SSE routes are skipped with a warning log instead of crashing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
command appends to the Dockerfile ENTRYPOINT, causing python -m plane_mcp
to receive 'sh' as the server mode argument. Use entrypoint override instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OAuth credentials are required by the app to start. For local dev without
a real OAuth app, dummy values allow the server to start with the header
API-key endpoint functional.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Documents install/upgrade/uninstall via helm.plane.so, minimal values.yaml
example, and full key values reference based on the plane-mcp-server chart.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f977d574-79af-4947-babb-3eb80bd4e473

📥 Commits

Reviewing files that changed from the base of the PR and between d72e27f and b8cbe12.

📒 Files selected for processing (1)
  • README.md
✅ Files skipped from review due to trivial changes (1)
  • README.md

📝 Walkthrough

Walkthrough

Adds Docker-based production and local development deployment artifacts, a .env.docker template, Dockerfile packaging tweaks, and expanded README + deployments docs for self-hosting and local development.

Changes

Cohort / File(s) Summary
Environment templates & ignores
\.env.docker, deployments/variables.env, \.gitignore
Added .env.docker template for Docker local envs and deployments/variables.env for production variables; updated .gitignore to exclude .env.docker.local and deployments/variables.env.local.
Docker image build
Dockerfile
Removed curl apt installation and replaced copying a prebuilt uv binary with pip install --no-cache-dir uv; retained remaining build and runtime steps.
Compose configurations
docker-compose.yml, deployments/docker-compose.yaml
Added local dev compose (plane-mcp-dev) with editable install, live code mount, and valkey service; added production compose referencing published image, healthchecks, valkey volume, and restart policies.
Documentation
README.md, deployments/README.md
Rewrote README with Self-Hosting and Local Development instructions (Docker and non-Docker flows), test and tooling guidance (switch to ruff format), and added deployments/README.md with Docker Compose and Helm deployment docs, variables, and troubleshooting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐇 I hopped through Docker, tidy and spry,
I left env templates where secrets lie.
Valkey hums, compose sings in tune,
Build, mount, and run — beneath the moon.
A carrot for tests, and off I zoom. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main changeset, which adds both development and production deployment configurations including Docker Compose files, environment templates, and deployment documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 infra/add-docker-compose-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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
deployments/README.md (1)

163-166: Minor: comment mentions "Redis" but the service is Valkey.

For consistency with the rest of the documentation, consider updating the comment.

📝 Suggested fix
 **Reset and start fresh:**
 ```bash
-docker compose down -v   # removes Redis volume too
+docker compose down -v   # removes Valkey volume too
 docker compose up -d

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @deployments/README.md around lines 163 - 166, Update the explanatory inline
comment next to the command "docker compose down -v" in the README so it refers
to Valkey instead of Redis (e.g., change the comment "removes Redis volume too"
to "removes Valkey volume too") to keep service names consistent with the rest
of the documentation.


</details>

</blockquote></details>
<details>
<summary>docker-compose.yml (1)</summary><blockquote>

`19-21`: **Entrypoint reinstalls dependencies on every container start.**

The current entrypoint runs `uv pip install --system -e '.[dev]'` each time the container starts, adding ~5-10s startup delay. This ensures dependencies stay synced with `pyproject.toml` changes but may be slower than desired for frequent restarts.

If faster restarts are preferred, you could add a conditional check or use a separate initialization script. However, for a dev workflow, the current approach is pragmatic and ensures consistency.

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docker-compose.yml around lines 19 - 21, The entrypoint is reinstalling deps
on every container start via the entrypoint array that runs "uv pip install
--system -e '.[dev]'" before "python -m plane_mcp http", causing slow restarts;
change this to either move the install step into a one-time init script (run at
image build or via a separate startup-only script) or add a conditional check in
the entrypoint that skips "uv pip install --system -e '.[dev]'" when
dependencies are already up-to-date (e.g., check for a marker file or compare
timestamps), then run "python -m plane_mcp http" as usual.


</details>

</blockquote></details>
<details>
<summary>deployments/variables.env (1)</summary><blockquote>

`21-24`: **Consider using a placeholder instead of `localhost` for production template.**

`PLANE_OAUTH_PROVIDER_BASE_URL=http://localhost:8211` may be overlooked in production deployments, causing OAuth callbacks to fail. A placeholder makes it clearer this must be changed.


<details>
<summary>📝 Suggested fix</summary>

```diff
 # Public URL your MCP clients reach the server on
-PLANE_OAUTH_PROVIDER_BASE_URL=http://localhost:8211
+PLANE_OAUTH_PROVIDER_BASE_URL=https://mcp.yourdomain.com
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deployments/variables.env` around lines 21 - 24, The
PLANE_OAUTH_PROVIDER_BASE_URL environment variable currently defaults to
"http://localhost:8211" which can be missed in production; update the template
to use a clear placeholder (e.g., "https://YOUR_DOMAIN[:PORT]" or
"https://mcp.example.com") so operators must replace it before deploy and
include the protocol and port if applicable; change the
PLANE_OAUTH_PROVIDER_BASE_URL entry to that placeholder and add a short comment
indicating it must be set to the public OAuth callback URL.
Dockerfile (1)

8-8: Consider pinning the uv version for reproducible builds.

The switch from GHCR copy to pip install avoids auth issues, but an unpinned uv may cause inconsistent builds. The latest version is 0.11.0.

♻️ Suggested fix
-RUN pip install --no-cache-dir uv
+RUN pip install --no-cache-dir uv==0.11.0
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile` at line 8, Pin the uv package to a specific version in the
Dockerfile to ensure reproducible builds: replace the current RUN pip install
--no-cache-dir uv invocation with a versioned install (e.g., uv==0.11.0) so the
RUN pip install command explicitly installs uv==0.11.0 rather than the unpinned
package.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@deployments/docker-compose.yaml`:
- Around line 3-5: Update the setup comment in docker-compose.yaml to reference
the correct template filename: change the instruction that says "cp
variables.env.example variables.env" to use the actual template name present in
the repo (e.g., "cp variables.env variables.env.example" or simply "cp
variables.env variables.env" depending on intended flow), and adjust the
subsequent note to say "edit variables.env" so the comment matches the real
template filename used by the project.

In `@README.md`:
- Around line 243-246: The fenced code block showing APP_RELEASE_VERSION lacks a
language specifier; update the README's snippet containing the line
"APP_RELEASE_VERSION=v0.2.8" to use an env language tag (e.g., start the block
with ```env) so syntax highlighting and accessibility are improved for that code
block.

---

Nitpick comments:
In `@deployments/README.md`:
- Around line 163-166: Update the explanatory inline comment next to the command
"docker compose down -v" in the README so it refers to Valkey instead of Redis
(e.g., change the comment "removes Redis volume too" to "removes Valkey volume
too") to keep service names consistent with the rest of the documentation.

In `@deployments/variables.env`:
- Around line 21-24: The PLANE_OAUTH_PROVIDER_BASE_URL environment variable
currently defaults to "http://localhost:8211" which can be missed in production;
update the template to use a clear placeholder (e.g.,
"https://YOUR_DOMAIN[:PORT]" or "https://mcp.example.com") so operators must
replace it before deploy and include the protocol and port if applicable; change
the PLANE_OAUTH_PROVIDER_BASE_URL entry to that placeholder and add a short
comment indicating it must be set to the public OAuth callback URL.

In `@docker-compose.yml`:
- Around line 19-21: The entrypoint is reinstalling deps on every container
start via the entrypoint array that runs "uv pip install --system -e '.[dev]'"
before "python -m plane_mcp http", causing slow restarts; change this to either
move the install step into a one-time init script (run at image build or via a
separate startup-only script) or add a conditional check in the entrypoint that
skips "uv pip install --system -e '.[dev]'" when dependencies are already
up-to-date (e.g., check for a marker file or compare timestamps), then run
"python -m plane_mcp http" as usual.

In `@Dockerfile`:
- Line 8: Pin the uv package to a specific version in the Dockerfile to ensure
reproducible builds: replace the current RUN pip install --no-cache-dir uv
invocation with a versioned install (e.g., uv==0.11.0) so the RUN pip install
command explicitly installs uv==0.11.0 rather than the unpinned package.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8de76d01-3af1-4706-b102-779148e2cc4b

📥 Commits

Reviewing files that changed from the base of the PR and between 608ff38 and f99a536.

📒 Files selected for processing (8)
  • .env.docker
  • .gitignore
  • Dockerfile
  • README.md
  • deployments/README.md
  • deployments/docker-compose.yaml
  • deployments/variables.env
  • docker-compose.yml

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
README.md (1)

300-300: Use safer .env loading for test command.

On Line 300, export $(cat .env.test.local | xargs) breaks on spaces/special chars. Prefer shell-native sourcing.

Suggested doc fix
-export $(cat .env.test.local | xargs) && pytest tests/ -v
+set -a
+source .env.test.local
+set +a
+pytest tests/ -v
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 300, Replace the fragile export pipeline on Line 300 that
uses "export $(cat .env.test.local | xargs) && pytest tests/ -v" with a
shell-native sourcing approach: use "set -a; . .env.test.local; set +a; pytest
tests/ -v" (or "set -a; source .env.test.local; set +a; pytest tests/ -v") so
environment variables from .env.test.local are safely exported even with
spaces/special characters.
🤖 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 239-241: The README's OAuth server URL is incorrect; update the
documented OAuth endpoint from "/mcp" to "/http/mcp" to match the actual mount
used in plane_mcp.__main__ (Mount "/http") so the OAuth transport path aligns
with the app's mounting; change the line listing `http://localhost:8211/mcp` to
`http://localhost:8211/http/mcp`.

---

Nitpick comments:
In `@README.md`:
- Line 300: Replace the fragile export pipeline on Line 300 that uses "export
$(cat .env.test.local | xargs) && pytest tests/ -v" with a shell-native sourcing
approach: use "set -a; . .env.test.local; set +a; pytest tests/ -v" (or "set -a;
source .env.test.local; set +a; pytest tests/ -v") so environment variables from
.env.test.local are safely exported even with spaces/special characters.
🪄 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: fa6ebe08-1beb-496a-aa8d-b278a683f9b9

📥 Commits

Reviewing files that changed from the base of the PR and between f99a536 and d72e27f.

📒 Files selected for processing (2)
  • README.md
  • deployments/docker-compose.yaml
✅ Files skipped from review due to trivial changes (1)
  • deployments/docker-compose.yaml

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.

1 participant