Make the repo self-hostable: root-default image, one-command compose, deploy docs - #4
Draft
asymetryk wants to merge 4 commits into
Draft
Make the repo self-hostable: root-default image, one-command compose, deploy docs#4asymetryk wants to merge 4 commits into
asymetryk wants to merge 4 commits into
Conversation
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>
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.
Continues the "anybody can deploy this repo" initiative (follows PR #3). Covers deployability slices 2, 3, 5, and 7.
Changes
Dockerfileno longer bakesBASE_PATH=/observatory; it defaultsBASE_PATH/SOURCE_REVISIONto root/devand 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).docker-compose.ymlgains awebservice that builds the image and serves the demo app athttp://localhost:3000with a health check. Postgres moves behind an optionaldbprofile, since the app runs in demo mode and onlydrizzle-kitneeds the database.DEPLOY.md(demo mode, Compose, plain Docker at root/subpath, local Node, Cloudflare, env-var reference).README.mdnow leads with a one-command self-host and a local-first MCP endpoint, keeping the homelab URL only as a labeled aside.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 testall pass (25 tests). Because no Docker daemon is available in the agent VM, I validated the image path directly instead:BASE_PATH="").node apps/web/server.js, with.next/static+publiccopied as the Dockerfile does) serves/→ 200,/api/health→{"ok":true,...}, and the compose healthcheck command exits 0. Static assets (CSS) resolve (200)./=200,/api/health=200;BASE_PATH=/observatoryserver →/=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.