Repository navigation
Add production deployment setup (Docker, compose, deploy script, health checks, docs) - #2
Merged
Merged
Conversation
…usy timeout, env example Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…althchecks) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…s, docker CI job Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #1: a practical, secure deployment path for the HTTP and MCP servers, plus a few small runtime fixes it surfaced.
Deployment
Dockerfile: multi-stage (uv builder →python:3.12-slim), non-rootpipuid 10001,/datavolume (key + sqlite), read-only policy mount at/config/policy.yaml,HEALTHCHECKon$PIP_HEALTH_PORT/healthz(8642 http / 8643 mcp).ENTRYPOINT docker/entrypoint.shmapsserve-http/serve-mcp(streamable-http) / any otherpip-nodesubcommand (keygen,identity).docker-compose.yml:pip-http+pip-mcpsharing onepip-datavolume (same identity), ports bound to127.0.0.1only,read_only,cap_drop: ALL,no-new-privileges, optional.env(required: false).deploy/deploy.sh up|down|status|logs|keygen|identity(bootstraps.env/policy.yamlfrom examples with warnings, waits for both health endpoints),deploy/Caddyfile.example(TLS termination),deploy/systemd/*.service.example(hardened bare-metal alternative).docs/DEPLOYMENT.md(linked from README/SECURITY): local run, container run, compose, TLS, key/policy/bearer handling, health/metrics, upgrades, checklist.dockerjob builds the image, validates compose, runs the container, waits forhealthy, checks/.well-known/pipreturns a handshake.Runtime changes
Settings.mcp_port(default 8643) so both transports run side-by-side on one host;serve-mcpuses it.build_mcp_http_app(server, bearer_token): wraps the streamable-http app withGET /healthz(exempt from bearer) and propagates the inner lifespan (lifespan=inner.router.lifespan_context) — without it the MCP session manager never started when mounted. Test now performs a real JSON-RPCinitializeagainst/mcp.Settingsvalidator: emptyPIP_HTTP_BEARER_TOKEN=/PIP_PUBLIC_*_URL=in.env→None(an empty string previously enabled the bearer gate).SqliteStore:timeout=5busy timeout (two processes share the DB in WAL mode).config/.env.exampleadded (referenced by README but missing from main);.envandconfig/policy.yamlgitignored.Verified: ruff / ruff format / mypy strict / pytest (122) green;
docker build,docker compose config -q,docker compose up -d→ both containershealthy,/healthzon 8642 and 8643,/.well-known/piphandshake, MCPinitializePOST on:8643/mcp→ 200 withserverInfo.name == "pip-v1".Assumptions: TLS is terminated by a reverse proxy (ports stay loopback-only); one key shared by both transports of an instance; policy edits require a restart; the image binds
0.0.0.0inside the container only.Link to Devin session: https://app.devin.ai/sessions/4104d923252c419994b9ebddc2f28bec
Open in Devin Desktop: https://app.devin.ai/desktop/session/4104d923252c419994b9ebddc2f28bec?variant=devin
Requested by: @CommunityPoke