Next.js Example

Below is an example of a flightcontrol.json configuration file for a Next.js project.

The buildCommand will trigger a Next.js production build.

Configuration as Code

flightcontrol.json
{
  "environments": [
    {
      "id": "production",
      "name": "Production",
      "region": "us-west-2",
      "source": {
        "branch": "main"
      },
      "services": [
        {
          "id": "my-nextjs",
          "name": "My Nextjs",
          "type": "web",
          "target": {"type": "fargate"},
          "buildType": "nixpacks",
          "ci": {
            "type": "ec2"
          },
          "cpu": 0.25,
          "memory": 0.5,
          "minInstances": 1,
          "maxInstances": 1,
          "buildCommand": "npm run build",
          "startCommand": "npm run start",
          "envVariables": {
            "DATABASE_URL": {
              "fromService": {
                "id": "db",
                "value": "dbConnectionString"
              }
            }
          }
        },
        {
          "id": "db",
          "name": "Database",
          "type": "rds",
          "engine": "postgres",
          "engineVersion": "12",
          "instanceSize": "db.t4g.micro",
          "storage": 20,
          "private": false
        }
      ]
    }
  ]
}