A New Collection of Thoughtful Learning Apps — Now Available on iOS & Android

Image
I’m excited to share a set of mobile apps I’ve recently completed and published on both the Google Play Store and the Apple App Store. These apps are designed with a simple goal in mind: to make meaningful, structured content more accessible, whether you’re studying theology or improving your English vocabulary. 📱 Now Available on Both Platforms All apps are live and available for download: Google Play Developer Page: https://play.google.com/store/apps/dev?id=5835943159853189043 Apple App Store Developer Page: https://apps.apple.com/ca/developer/q-z-l-corp/id1888794100 📖 Theology & Confession Study Apps For those interested in Reformed theology and classical Christian teachings, I’ve developed a series of apps that present foundational texts in a clean, focused reading format: The Belgic Confession Canons of Dort Heidelberg Catechism Westminster Shorter Catechism Each app is designed to provide a distraction-free experience, making it easier to read, reflect, and revisit these im...

Deploying a Next.js App in Standalone Mode to OpenShift / Kubernetes


Most Next.js tutorials assume you deploy on Vercel. That works great — until you are in an enterprise environment where:

  • You must deploy into OpenShift or a Kubernetes cluster
  • You need a custom Node.js runtime image
  • You want full control over networking, certificates, and scaling

In this post, we’ll walk through how to deploy a Next.js app in standalone mode, using a normal build process and a custom Docker image — no Vercel involved.


Why Standalone Mode?



Next.js standalone mode bundles:

  • The compiled server (server.js)
  • Only the required Node.js dependencies
  • A minimal runtime footprint

This makes it ideal for containerized environments like OpenShift and Kubernetes.


1️⃣ Build the App Normally

There is nothing special here. You still install dependencies and run a standard Next.js build:

npm ci
npm run build

Your next.config.js must enable standalone output:

module.exports = {
  output: 'standalone',
};

2️⃣ Understand the Build Output

After the build, Next.js generates a folder like:

.next/standalone

Inside it, you’ll find:

  • A minimal node_modules
  • The compiled server entry: .next/standalone/apps/<your-app>/server.js

Important: Static assets and public files are not automatically copied. You must do this yourself.


3️⃣ Copy Static and Public Assets

This is the key step many people miss. After the build, copy static files into the standalone folder:

cp -R dist/apps/example-app/.next/static \
  dist/apps/example-app/.next/standalone/dist/apps/example-app/.next/static

cp -R dist/apps/example-app/public \
  dist/apps/example-app/.next/standalone/apps/example-app/public

Now the standalone server can correctly serve:

  • /_next/static/*
  • /public/*

4️⃣ Dockerfile for OpenShift / Kubernetes

Below is a simplified Dockerfile using a custom Node.js runtime image. The image name and app path are intentionally generalized.

FROM image-registry.openshift-image-registry.svc:5000/internal/nodejs-runtime:22

WORKDIR /app

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1

USER root
ADD app.tar.gz .

RUN chown -R 1001:0 /app && chmod -R g+rwx /app

USER 1001

EXPOSE 3000
ENV PORT=3000

CMD NODE_EXTRA_CA_CERTS=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem \
node .next/standalone/apps/example-app/server.js

Key points:

  • No development dependencies
  • No next start
  • We run the generated server.js directly

5️⃣ Why This Works Well in OpenShift



  • Runs as a non-root user (UID 1001)
  • Compatible with OpenShift SCC restrictions
  • Fast startup time
  • Small runtime footprint

This pattern works equally well for:

  • OpenShift
  • Vanilla Kubernetes
  • On-prem clusters
  • Private cloud environments

Final Thoughts

You don’t need Vercel to run Next.js properly. With standalone output and a small amount of asset wiring, you get a clean, production-ready deployment that fits perfectly into enterprise Kubernetes platforms.

If you’re already building Next.js apps for large organizations, this approach gives you control, predictability, and portability.

❤️ Support This Blog


If this post helped you, you can support my writing with a small donation. Thank you for reading.


Comments

Popular Posts

Next.js + NextAuth.js — Keycloak SSO Integration

QZL Compare:免费在线文件与文件夹对比工具,无需安装,隐私安全