Skip to content

Deployment: publish production images and a complete Compose stack #392

Open

Description

@imshashank

Current status, September 22

The local Docker evaluation path shipped in #472, and the one-command launcher is being reviewed in #486. These are Preview steps only: published immutable web/realtime images, production proxy and cron topology, multi-architecture publishing, SBOM/provenance and the clean-install/upgrade matrix remain open. Keep #391, #393 and #394 linked as prerequisites for the production distribution claim.

Original requirements

Goal

Publish reproducible, versioned Orbit application images and one production-shaped Compose definition that a stranger can deploy without assembling the architecture by hand.

This is a sibling of #391 under #388 and implements the application-container work tracked as DEP-003, DEP-005, CI-001, and part of REL-002 in docs/open-source-readiness.md.

Current boundary

  • The repository has no application Dockerfile.
  • The root docker-compose.yml starts Postgres, Redis, MinIO, and bucket initialization only.
  • That Compose file exposes dependency ports and contains public development credentials, so it is not a production distribution artifact.
  • apps/web already produces a copied Next.js standalone artifact and runs it with Node.
  • CI already smoke-tests the copied standalone artifact.
  • apps/realtime already builds a Bun artifact and has a start command.
  • bun run db:release already provides the locked production migration entry point.

Build on those existing contracts. Do not replace a tested standalone build with a second ad hoc server.

Deliverables

1. Canonical OCI images

Publish at least:

ghcr.io/noveum/orbit-web:<version>
ghcr.io/noveum/orbit-realtime:<version>

Use the web image for the one-shot migration command unless there is a measured reason to maintain a third image.

Each release image must:

  • support linux/amd64 and linux/arm64
  • use an immutable version tag and digest
  • carry OCI source, revision, version, license, title, and documentation labels
  • contain only the production runtime and required assets
  • run as a non-root user where the runtime permits it
  • define a clear writable-filesystem contract
  • start without package installation or source compilation
  • contain no .env, credential, test database, demo upload, or build-service token
  • be reproducible from the tagged source revision

latest may exist as a convenience alias, but no catalog template may depend on it.

2. Full production Compose topology

Add a production file distinct from the development infrastructure file, for example:

deploy/compose/compose.yaml

The all-in-one profile should include:

  • reverse proxy
  • web
  • realtime
  • one-shot migration
  • Postgres
  • Redis
  • MinIO or another explicitly supported S3-compatible local service
  • bucket initialization

Only the reverse proxy should publish a host port by default. Postgres, Redis, object storage, web, and realtime remain on private networks unless an operator deliberately changes the topology.

The same file may support external Postgres, Redis, and S3 through documented profiles or overrides, but the first release must keep one self-contained path that can be tested without third-party SaaS accounts.

3. Startup and dependency ordering

  • The migration job takes the database lock, applies and verifies migrations, and exits successfully.
  • Web and realtime do not accept traffic until required migration and dependency readiness conditions pass.
  • Restarting application services never reruns destructive seed or reset behavior.
  • A failed migration prevents rollout instead of starting new application code against an incompatible schema.
  • Redis remains disposable; Postgres and object storage remain durable.
  • Bucket creation is idempotent.
  • Compose shutdown and restart do not corrupt data or leave the installation in a half-migrated state.

4. Secret contract

No default production password is committed.

The operator-facing path must either:

  • require every secret through Compose secrets or an external environment file generated locally, or
  • include a checked-in generator that writes a gitignored secrets file with cryptographically random values.

At minimum cover:

  • BETTER_AUTH_SECRET
  • Postgres user and password
  • Redis authentication if enabled
  • object-storage access and secret keys
  • any first-owner/bootstrap secret introduced by the sibling bootstrap issue

The production entry points must reject known example values, placeholders, empty secrets, and development-only login flags.

5. Health and container behavior

  • Web exposes minimal liveness and readiness separately.
  • Realtime exposes the minimal contract agreed in Deployment: run realtime behind a provider-neutral same-origin WebSocket proxy #391.
  • Postgres, Redis, and object storage use pinned images and native health checks.
  • Compose health checks do not include secrets on the command line where they become visible through process inspection.
  • Application logs go to stdout/stderr in structured form.
  • SIGTERM reaches the Node and Bun processes and results in bounded graceful shutdown.

6. Release workflow

For every supported release tag:

  • build both architectures
  • run image-level smoke tests
  • push immutable tags to GHCR
  • optionally mirror identical images to Docker Hub after GHCR is proven
  • attach an SBOM
  • publish provenance tied to the exact source commit and image digest
  • run vulnerability scanning under the dependency policy selected for SEC-006
  • place the image references and digests in the release notes

Do not publish an image from an unreviewed pull request under a release tag.

Required tests

Build tests

  1. Build web and realtime images from a clean source checkout with no local cache dependency.
  2. Inspect the final filesystem and prove source secrets, development .env files, test fixtures, and build caches are absent.
  3. Start each image using only its documented runtime inputs.
  4. Run both images as their declared non-root user.
  5. Build and smoke-test amd64 and arm64 variants.

Clean installation

  1. Generate fresh secrets.
  2. Start the complete production Compose profile on a blank Docker host.
  3. Run the migration job once and verify it exits zero.
  4. Run it again and prove the operation is idempotent.
  5. Complete the first-owner flow defined by the sibling bootstrap issue.
  6. Create a workspace, issue, project, doc, comment, and file attachment.
  7. Verify two-browser realtime through the same-origin proxy from Deployment: run realtime behind a provider-neutral same-origin WebSocket proxy #391.
  8. Restart web, realtime, Redis, proxy, Postgres, and object storage.
  9. Prove all durable data and uploaded files remain and realtime reconnects.
  10. Bring the stack down without volumes, bring it back up, and repeat the persistence checks.

Upgrade installation

  1. Install the previous supported release from immutable digests.
  2. Seed representative application data through public product paths.
  3. Replace image digests with the candidate release.
  4. Run the migration job and roll application services.
  5. Prove data, authorization, uploads, MCP grants, and realtime still work.
  6. Record the supported forward-repair or rollback behavior for failures after a schema change.

CI

Add a production-container lane that runs when Dockerfiles, Compose, migrations, release scripts, or runtime packaging changes.

The lane must fail on:

  • a missing or floating application image tag
  • stale generated Compose/catalog output
  • unhealthy service startup
  • migration failure or drift
  • public dependency ports in the default production profile
  • default credentials
  • missing persistent volumes
  • failed two-browser realtime
  • failed restart persistence
  • failure to upgrade from the previous supported image

Nightly coverage may run the heavier multi-architecture and previous-release matrix, but every pull request changing deployment behavior needs at least one production-shaped clean-install smoke test.

Documentation

Document:

  • exact supported image names and tags
  • resource minimums and recommendations
  • every required variable and secret
  • persistent and disposable data
  • external Postgres, Redis, and S3 overrides
  • installation, upgrade, backup, restore, and uninstall behavior
  • reverse-proxy and DNS requirements
  • how to verify the running image digest
  • where to report security and operational issues

Update the Preview statement only when the complete release gate in #388 is satisfied. Landing images alone does not make self-hosting stable.

Likely files

  • new root or deployment-specific Dockerfiles
  • new .dockerignore
  • apps/web/scripts/prepare-standalone.ts
  • apps/web/package.json
  • apps/realtime/package.json
  • docker-compose.yml for development-only corrections
  • new deploy/compose/
  • .github/workflows/ci.yml
  • new release-image workflow or the existing release workflow
  • docs/self-hosting.md
  • docs/configuration.md
  • docs/troubleshooting.md
  • SECURITY.md

Not part of this issue

Review boundary

Split implementation into focused pull requests where practical:

  1. image construction and image smoke tests
  2. complete Compose topology and clean-install test
  3. multi-architecture release publishing, SBOM, provenance, and upgrade matrix

No pull request should be merged merely because an image builds. The release claim depends on the end-to-end installation and upgrade evidence above.

Activity

  1. self-assigned this
    on Sep 3, 2026
  2. added
    help wanted
    ci
    roadmap
    p1 high
    size: extra large
    points: 13
    on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cihelp wantedp1 highpoints: 13roadmapsize: extra large

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions