Containerize webapp + deploy to Oracle/Dokploy via GHCR (development)#283
Merged
Conversation
Migrate the mploy webapp 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 (Next.js 16 + npm, single-package frontend/, not a pnpm workspace). Dokploy deploys off `development`, so the workflow triggers on push to development. - 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: output "standalone" + outputFileTracingRoot pinned to the app dir so the entrypoint lands at .next/standalone/server.js. - 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). - 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>
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.
Adds the Docker/Dokploy/GHCR deploy pipeline to
development, which is now the branch Dokploy deploys from.Supersedes the target of #281 (which merged the same pipeline into
production). This PR carries the identical setup with the workflow trigger switched to push →development, applied on top of dev's current frontend.Changes
frontend/Dockerfile— multi-stagenode:22-slim, non-rootnextjsuser, runs the Next standalone server (node server.js).frontend/next.config.ts—output: "standalone"+outputFileTracingRootpinned to the app dir (so the entrypoint lands flat at.next/standalone/server.js), keepingserverExternalPackages.frontend/.dockerignore— lean, deterministic build context..github/workflows/deploy.yml— buildlinux/arm64onubuntu-24.04-arm, pushghcr.io/monashcoding/mploy:latest+ sha tag withtype=ghacache, then POST the Dokploy webhook. Triggers on push todevelopment. Redeploy step self-skips untilDOKPLOY_DEPLOY_WEBHOOKexists.docs/deploy.md— Dokploy runbook (Docker provider, runtime env, port3000,jobs.monashcoding.com, Cloudflare grey-cloud-first).Key facts (same as #281)
frontend/is a standalone app (not a workspace) → build context./frontend, no build-args.NEXT_PUBLIC_*vars;next builddoes not touch MongoDB (/jobs=ƒ Dynamic) → all secrets are runtime env in Dokploy. MongoDB is external (Atlas).Verified on dev's codebase
npm ci+npm run buildpass (TypeScript check included); build with noMONGODB_URIsucceeds → no DB at build time..next/standalone/server.jslands flat, matching the DockerfileCMD.Note on
productionproductionstill has the pipeline from #281 with aproductiontrigger. Since Dokploy now deploys offdevelopment, you likely want to either revert/neutralize the workflow onproductionor let the branches reconcile — happy to open that cleanup PR if you want.🤖 Generated with Claude Code