Skip to content

feat(deploy): bake migrations into relay image, migrate from same image - #748

Merged
phoenix-server merged 1 commit into
mainfrom
feat/bake-migrations
Aug 30, 2026
Merged

feat(deploy): bake migrations into relay image, migrate from same image#748
phoenix-server merged 1 commit into
mainfrom
feat/bake-migrations

Conversation

@phoenix-server

Copy link
Copy Markdown
Collaborator

Summary

The relay image (ghcr.io/cameri/nostream:main) ships without migrations/ or knexfile.js, so relay-server operators must hand-maintain a separate migrate image plus host-mounted migration files — which silently drifts from the code that ships.

  • Bake migrations/ and knexfile.js into the Docker runtime stage
  • Point deploy/docker-compose.prod.yml's nostream-migrate service at the relay image itself (node_modules/.bin/knex migrate:latest)
  • One artifact, one pull; compose recreates the one-shot migrate container whenever the image digest changes, so migrations re-run on every release with no extra flags

Verification

Built the image locally and ran the migrate command against a throwaway postgres:15: all 32 migrations applied (Batch 1 run: 32 migrations), exit 0, knex_migrations shows 32 rows with 20260812_150000_create_dvm_jobs_table.js latest. Repo hooks (biome lint, build:check, unit tests) pass.

The relay image shipped without migrations or knexfile, forcing operators
to hand-maintain a separate migrate image plus host-mounted migration
files — which silently drifts from the code that ships. Bake
migrations/ and knexfile.js into the runtime stage and point the
prod compose nostream-migrate service at the relay image itself
(knex migrate:latest). One artifact, one pull; compose recreates the
one-shot migrate container whenever the image digest changes, so
migrations re-run on every release with no extra flags.

Verified locally: image builds, throwaway postgres, knex applies all
32 migrations, exit 0.
@changeset-bot

changeset-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 69651c8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@phoenix-server
phoenix-server merged commit 29234a8 into main Aug 30, 2026
19 of 20 checks passed
@phoenix-server
phoenix-server deleted the feat/bake-migrations branch August 30, 2026 01:22
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

Coverage is 71.326%feat/bake-migrations into main. No base build found for main.

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