Containerize webapp + deploy to Oracle/Dokploy via GHCR#281
Merged
Conversation
Migrate the mploy webapp off its current host to a Docker container on the Oracle Cloud VM, deployed by Dokploy from an image built in GitHub Actions and pushed to GHCR. Mirrors the monmap setup, adapted to this repo's stack (Next.js 16 + npm, single-package frontend/, not a pnpm workspace). - frontend/Dockerfile: multi-stage (deps → build → runner), node:22-slim, non-root nextjs user, runs the Next.js standalone server. No build-args — the app has no NEXT_PUBLIC_* vars and `next build` doesn't touch MongoDB, so all secrets are runtime env in Dokploy. - frontend/next.config.ts: pin outputFileTracingRoot to the app dir so the standalone entrypoint lands at .next/standalone/server.js; keep serverExternalPackages. - frontend/.dockerignore: keep the build context lean/deterministic. - .github/workflows/deploy.yml: build linux/arm64 on ubuntu-24.04-arm, push ghcr.io/monashcoding/mploy:latest + sha tag with gha cache, then POST the Dokploy webhook (self-skips until DOKPLOY_DEPLOY_WEBHOOK is set). Triggers on push to production. - docs/deploy.md: Dokploy runbook (Docker provider, runtime env, port 3000, jobs.monashcoding.com, Cloudflare grey-cloud-first for the cert). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Migrate the mploy webapp off its current host to a Docker container on the Oracle Cloud VM, deployed by Dokploy from an image built in GitHub Actions and pushed to GHCR. Mirrors the monmap setup, adapted to this repo's stack (Next.js 16 + npm, single-package frontend/, not a pnpm workspace). - frontend/Dockerfile: multi-stage (deps → build → runner), node:22-slim, non-root nextjs user, runs the Next.js standalone server. No build-args — the app has no NEXT_PUBLIC_* vars and `next build` doesn't touch MongoDB, so all secrets are runtime env in Dokploy. - frontend/next.config.ts: pin outputFileTracingRoot to the app dir so the standalone entrypoint lands at .next/standalone/server.js; keep serverExternalPackages. - frontend/.dockerignore: keep the build context lean/deterministic. - .github/workflows/deploy.yml: build linux/arm64 on ubuntu-24.04-arm, push ghcr.io/monashcoding/mploy:latest + sha tag with gha cache, then POST the Dokploy webhook (self-skips until DOKPLOY_DEPLOY_WEBHOOK is set). Triggers on push to production. - docs/deploy.md: Dokploy runbook (Docker provider, runtime env, port 3000, jobs.monashcoding.com, Cloudflare grey-cloud-first for the cert). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ding/mploy-app into oliver/dokploy-deploy
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.
Migrate the mploy webapp off its current host to a Docker container on the Oracle Cloud VM, deployed by Dokploy from an image built in GitHub Actions and pushed to GHCR. Mirrors the
monmapmigration, adapted to this repo's stack.What this repo actually is (vs monmap)
frontend/, npm (not pnpm), not a monorepo —frontend/is a self-contained npm app; the Spring Bootbackend/is a separate service. So: build context isfrontend/, no Corepack/pnpm pinning, notranspilePackages.NEXT_PUBLIC_*build vars (GA id is hardcoded) → the image takes zero build-args.next builddoes not touch MongoDB — every DB route isforce-dynamicor readssearchParams(/jobsrendersƒ Dynamic). Verified by building with noMONGODB_URI. All DB/auth/Notion values are runtime env in Dokploy.Changes
frontend/Dockerfile— multi-stage (deps → build → runner),node:22-slim, non-rootnextjsuser, runs the Next standalone server (node server.js).frontend/next.config.ts— pinoutputFileTracingRootto the app dir so the standalone entrypoint lands at.next/standalone/server.js(the empty rootpackage-lock.jsonwould otherwise nest it underfrontend/); keepserverExternalPackages.frontend/.dockerignore— lean, deterministic build context..github/workflows/deploy.yml— buildlinux/arm64onubuntu-24.04-arm, pushghcr.io/monashcoding/mploy:latest+ a sha tag withtype=ghacache, then POST the Dokploy webhook. Triggers on push toproduction. The redeploy step self-skips until theDOKPLOY_DEPLOY_WEBHOOKsecret exists.docs/deploy.md— Dokploy runbook: Docker provider onghcr.io/monashcoding/mploy:latest, runtime env vars, port3000, domainjobs.monashcoding.com, Cloudflare grey-cloud-first so Let's Encrypt can issue the cert.Verified locally
npm ci+npm run build(production) pass; TypeScript check passes as part of the build.MONGODB_URIsucceeds → build doesn't reach the DB..next/standalone/server.jslands flat at the root, matching the DockerfileCMD.Follow-up (out of band, not in this PR)
DOKPLOY_DEPLOY_WEBHOOKafter the Dokploy app is created.read:packagestoken).jobs.monashcoding.com; MongoDB is external (Atlas) — no on-box private-IP caveat.🤖 Generated with Claude Code