Skip to content

feat(docker): production image and Docker Hub publishing - #187

Merged
WhiteMuush merged 3 commits into
mainfrom
develop
Sep 2, 2026
Merged

feat(docker): production image and Docker Hub publishing#187
WhiteMuush merged 3 commits into
mainfrom
develop

Conversation

@WhiteMuush

Copy link
Copy Markdown
Owner

Promotion of develop to main. The scope is the Docker work from #186, nothing else is pending.

What lands

  • Dockerfile becomes the production image: multi-stage build, Next.js standalone server, unprivileged node user, healthcheck on /api/health.
  • The previous development image moves to Dockerfile.dev; compose.yml points at it, so the local stack is unchanged.
  • docker/entrypoint.sh refuses to start without DATABASE_URL, applies prisma migrate deploy, then execs the server. RUN_MIGRATIONS=false skips the migration step when a separate job owns the schema.
  • .github/workflows/docker-publish.yml builds and pushes on v*.*.* tags, plus an edge tag on manual dispatch. The job runs in the protected dockerhub environment: manual approval required, restricted to main, develop and release tags.

Why this promotion now

GitHub only exposes workflow_dispatch for workflows present on the default branch. Landing this on main makes the publish job dispatchable, so the credentials and the approval gate can be validated against a throwaway edge tag instead of during a real release.

Verification

The image was built locally and run against the development database: 30 migrations applied, /api/health returns {"status":"ok","db":"up"}, /login serves 200. All 15 checks passed on #186.

WhiteMuush and others added 3 commits September 2, 2026 15:25
The only image so far was the development one: it bind-mounts the source and
runs `next dev`, so it cannot be distributed. This adds a real production
image and the workflow that publishes it.

The build is multi-stage. Next.js now emits a standalone server bundle, so the
runner carries the traced runtime only instead of the full node_modules. It
runs as the unprivileged `node` user and exposes a healthcheck against
/api/health.

Migrations are applied by the entrypoint before the server starts. The Prisma
CLI could not simply be copied out of the app dependencies (its config loader
pulls packages that the Next.js trace drops), so it gets its own install tree
under /opt/prisma, pinned to the lockfile version. Set RUN_MIGRATIONS=false
when a separate job owns the schema.

The former Dockerfile becomes Dockerfile.dev and compose.yml points at it, so
the local stack is unchanged.

Verified by building the image and running it against the local database:
migrations applied, /api/health returns db up, /login serves 200.
Without a gate, anyone able to push a `v*` tag triggers an immediate public
image push. The job now runs in the `dockerhub` environment, which requires a
manual approval and is restricted to `main`, `develop` and release tags. The
Docker Hub credentials move to that environment as well.
feat(docker): add production image and Docker Hub publishing
@WhiteMuush
WhiteMuush merged commit 265f537 into main Sep 2, 2026
27 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in DataShield Roadmap Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant