ガイド一覧

NestJS

Build, then run dist/main.js.

  1. 1main.ts

    The platform sets the PORT environment variable (default 8080). Listen on 0.0.0.0:$PORT.

    ts
    const app = await NestFactory.create(AppModule);
    await app.listen(process.env.PORT ?? 8080, '0.0.0.0');
  2. 2package.json

    The generated Dockerfile runs the build script when present, then start.

    json
    "scripts": {
      "build": "nest build",
      "start": "node dist/main.js"
    }
  3. 3Deploy (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

関連ガイド