# The configuration file

> Every field of the [run] table in sypnia.toml.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://run.docs.sypnia.com/config/run-file/

For agents: Run reads the [run] table of sypnia.toml, the one configuration file of the project at the repository root (top-level format = 1 and project = "<project>"; other products' tables are ignored; the Run CLI rewrites only [run] and keeps comments; never secrets). Each app is a table [run.apps.<name>] (name: lowercase letters, digits, dashes, unique in the project) with keys in snake_case: root, kind (static|ssr|container|function), framework, build {command, output, node, env}, runtime (lambda|fargate), memory, timeout, min_instances, max_instances, cpu, health_check {path, timeout}, spa, headers/redirects/rewrites, functions, jobs, queues, previews.protection, release.auto_rollback, telemetry, use_cases, cases.split, cases.handlers. Unknown keys in [run] are errors.

Every Sypnia product reads one file: `sypnia.toml`, at the root of your repository. Run reads its `[run]` table and ignores the tables of the other products. Each app is a table of its own, `[run.apps.<name>]`. Everything is optional; Run fills in what is missing from your project and prints what it decided in the build log.

`sypnia.toml`

```toml
format = 1
project = "la-espiga"

[run.apps.laespiga]
kind = "ssr"
framework = "nextjs"
```

The first `npx @sypnia/run deploy` writes the app's table for you. The Run command line only ever rewrites the `[run]` table, and keeps your comments. Never put secrets in this file: they go in [environment variables and secrets](https://run.docs.sypnia.com/config/environment-and-secrets).

## The project

| Key       | Type   | What it is                                                                                               |
| --------- | ------ | -------------------------------------------------------------------------------------------------------- |
| `format`  | `1`    | the format of the file                                                                                   |
| `project` | string | the Sypnia project the apps belong to; asked on the first deploy if missing, and shared by every product |

## An app: `[run.apps.<name>]`

The table's name is the app's name: lowercase letters, digits and dashes, unique in the project.

| Key                                                   | Type                                        | Default  | What it does                                                                                                                                                                                     |
| ----------------------------------------------------- | ------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `root`                                                | string                                      | `.`      | The app's folder in a monorepo                                                                                                                                                                   |
| `kind`                                                | `static` · `ssr` · `container` · `function` | detected | The app's kind                                                                                                                                                                                   |
| `framework`                                           | string                                      | detected | `nextjs`, `astro`, `sveltekit`, `nuxt`, `react-router`, `vite`…                                                                                                                                  |
| `build.command`                                       | string                                      | detected | The build command                                                                                                                                                                                |
| `build.output`                                        | string                                      | detected | The output folder for static sites                                                                                                                                                               |
| `build.node`                                          | string                                      | `22`     | Node major version                                                                                                                                                                               |
| `build.env`                                           | list                                        | `[]`     | Variables available at build time                                                                                                                                                                |
| `runtime`                                             | `lambda` · `fargate`                        | `lambda` | For containers: `fargate` asks for an always-on container ([A container on Fargate](#a-container-on-fargate))                                                                                    |
| `memory`, `timeout`, `min_instances`, `max_instances` | numbers                                     | per kind | The server part's size and scaling                                                                                                                                                               |
| `cpu`                                                 | number                                      | 0.5      | vCPU for Fargate                                                                                                                                                                                 |
| `health_check.path`, `health_check.timeout`           | string, seconds                             | `/`, 5   | The health check                                                                                                                                                                                 |
| `spa`                                                 | boolean                                     | `false`  | Fall back to `index.html`                                                                                                                                                                        |
| `headers`, `redirects`, `rewrites`                    | lists                                       | `[]`     | Applied at the edge                                                                                                                                                                              |
| `functions`                                           | tables                                      | none     | [Functions](https://run.docs.sypnia.com/apps/functions) next to the app                                                                                                                          |
| `jobs`                                                | tables                                      | none     | [Scheduled jobs](https://run.docs.sypnia.com/jobs/cron)                                                                                                                                          |
| `queues`                                              | tables                                      | none     | [Queues](https://run.docs.sypnia.com/jobs/queues)                                                                                                                                                |
| `previews.protection`                                 | string                                      | `sypnia` | [Preview access](https://run.docs.sypnia.com/deploys/previews)                                                                                                                                   |
| `release.auto_rollback`                               | table                                       | off      | [Automatic rollback](https://run.docs.sypnia.com/deploys/promote-and-rollback#automatic-rollback)                                                                                                |
| `telemetry`                                           | boolean or table                            | `false`  | [Send logs and traces to Sypnia Telemetry](https://run.docs.sypnia.com/observe/telemetry-and-use-cases)                                                                                          |
| `use_cases`                                           | string                                      | none     | The folder of the use-case map (`"cases"`), or `"sypnorm"` to build it from the code ([Use cases](https://run.docs.sypnia.com/cases))                                                            |
| `cases.split`                                         | tables                                      | none     | Cases that get a service of their own, with `memory`, `timeout`, `runtime`, `concurrency` ([How use cases run](https://run.docs.sypnia.com/cases/how-cases-run#one-service-per-area))            |
| `cases.handlers`                                      | table                                       | none     | For cases written in another language: the function or container route that runs each one ([Code in another language](https://run.docs.sypnia.com/cases/how-cases-run#code-in-another-language)) |

A key in `[run]` that the engine does not know is an error, so a typo never passes silently.

## Several apps

A monorepo lists each app with its folder:

`sypnia.toml`

```toml
format = 1
project = "la-espiga"

[run.apps.web]
root = "apps/web"
kind = "ssr"

[run.apps.kitchen-api]
root = "apps/kitchen-api"
kind = "container"
min_instances = 1
```

## A container on Fargate

Every app runs on functions unless its table says otherwise. An app that needs an always-on container (work longer than 15 minutes, WebSockets, a worker that never stops) asks for it with two lines:

`sypnia.toml`

```toml
[run.apps.kitchen-live]
root = "apps/kitchen-live"
kind = "container"
runtime = "fargate"   # without this line, the image runs as a function that scales to zero
cpu = 0.5
min_instances = 1
```

A container on Fargate is billed for every hour it is on. When to choose it: [Functions or containers](https://run.docs.sypnia.com/architecture#functions-or-containers).
