Skip to content

Make the repo self-hostable: root-default image, one-command compose, deploy docs - #4

Draft
asymetryk wants to merge 4 commits into
mainfrom
cursor/self-host-deploy-91a1
Draft

Make the repo self-hostable: root-default image, one-command compose, deploy docs#4
asymetryk wants to merge 4 commits into
mainfrom
cursor/self-host-deploy-91a1

Conversation

@asymetryk

Copy link
Copy Markdown
Owner

Continues the "anybody can deploy this repo" initiative (follows PR #3). Covers deployability slices 2, 3, 5, and 7.

Changes

  • Image serves at root by default (slice 3). Dockerfile no longer bakes BASE_PATH=/observatory; it defaults BASE_PATH/SOURCE_REVISION to root/dev and re-declares the build args in the runtime stage. Deploy under a subpath with --build-arg BASE_PATH=/observatory (as the operator's K3s UAT does).
  • One-command self-host (slice 2). docker-compose.yml gains a web service that builds the image and serves the demo app at http://localhost:3000 with a health check. Postgres moves behind an optional db profile, since the app runs in demo mode and only drizzle-kit needs the database.
  • Self-host deploy guide (slice 5). New DEPLOY.md (demo mode, Compose, plain Docker at root/subpath, local Node, Cloudflare, env-var reference). README.md now leads with a one-command self-host and a local-first MCP endpoint, keeping the homelab URL only as a labeled aside.
  • K3s manifests labeled operator-reference (slice 7). New deployment/README.md + a header note make clear the Tailscale/K3s manifests are the maintainer's homelab setup, not a generic target.

Verification

pnpm lint, pnpm typecheck, pnpm test all pass (25 tests). Because no Docker daemon is available in the agent VM, I validated the image path directly instead:

  • Production build succeeds at root (BASE_PATH="").
  • The exact standalone runtime the image runs (node apps/web/server.js, with .next/static + public copied as the Dockerfile does) serves / → 200, /api/health{"ok":true,...}, and the compose healthcheck command exits 0. Static assets (CSS) resolve (200).
  • Base-path routing verified both ways: default server → /=200, /api/health=200; BASE_PATH=/observatory server → /=404, /observatory=200, /observatory/api/health=200.

Root (production standalone image) and subpath both render fully styled:

Production image serving the app at root

Same app served under /observatory via BASE_PATH

Note

Docker Compose itself couldn't be run end-to-end here (no Docker daemon in the Cloud Agent VM), but every layer it depends on (image build, runtime CMD, health endpoint, base path) is verified above.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 4 commits August 27, 2026 17:09
The Dockerfile baked BASE_PATH=/observatory, so a generic 'docker build'
produced an image that only served under /observatory. Default BASE_PATH
(and SOURCE_REVISION) to root/dev and re-declare the build args in the
runtime stage; the operator opts into the subpath with
--build-arg BASE_PATH=/observatory --build-arg SOURCE_REVISION=uat.

Co-authored-by: asymetryk <asymetryk@outlook.com>
Previously compose only defined a bare Postgres. Add a 'web' service that
builds the image and serves the demo app at http://localhost:3000 with a
health check, and move Postgres behind an optional 'db' profile since the
app runs in demo mode and only drizzle-kit needs the database.

Co-authored-by: asymetryk <asymetryk@outlook.com>
DEPLOY.md documents demo mode, Docker Compose, plain Docker (root or
subpath), local Node, and Cloudflare, plus the env-var reference. README
now leads with a one-command self-host and a local-first MCP endpoint,
keeping the homelab URL only as a labeled aside.

Co-authored-by: asymetryk <asymetryk@outlook.com>
Adds deployment/README.md and a header note pointing self-hosters to
DEPLOY.md, so the homelab Tailscale/K3s manifests are not mistaken for a
portable deploy path.

Co-authored-by: asymetryk <asymetryk@outlook.com>
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.

2 participants