All guides

Next.js

Detected as an SSR app: next build, then next start.

  1. 1package.json

    Pass the port to next start with -p.

    json
    "scripts": {
      "build": "next build",
      "start": "next start -H 0.0.0.0 -p ${PORT:-8080}"
    }
  2. 2Deploy (pick one)

    ① Connect GitHub: Project → Add service → GitHub repository (deploys on push) ② From this folder: oc up --wait (builds even without a Dockerfile) ③ Upload a folder or zip in the console: Add service → Upload source

    bash
    oc login
    oc project create my-app --link
    oc up --wait
  3. 3Environment variables

    NEXT_PUBLIC_* values are baked in at build time; redeploy after changing them.

    bash
    oc variables set NEXT_PUBLIC_API_URL=https://api.example.com
    oc redeploy --wait

Related guides