Skip to content

The configuration file

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

Applies to EngineCloud
View as Markdown
On this page
  1. The project
  2. An app: [run.apps.<name>]
  3. Several apps
  4. A container on Fargate

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
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.

The project

KeyTypeWhat it is
format1the format of the file
projectstringthe 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.

KeyTypeDefaultWhat it does
rootstring.The app’s folder in a monorepo
kindstatic · ssr · container · functiondetectedThe app’s kind
frameworkstringdetectednextjs, astro, sveltekit, nuxt, react-router, vite…
build.commandstringdetectedThe build command
build.outputstringdetectedThe output folder for static sites
build.nodestring22Node major version
build.envlist[]Variables available at build time
runtimelambda · fargatelambdaFor containers: fargate asks for an always-on container (A container on Fargate)
memory, timeout, min_instances, max_instancesnumbersper kindThe server part’s size and scaling
cpunumber0.5vCPU for Fargate
health_check.path, health_check.timeoutstring, seconds/, 5The health check
spabooleanfalseFall back to index.html
headers, redirects, rewriteslists[]Applied at the edge
functionstablesnoneFunctions next to the app
jobstablesnoneScheduled jobs
queuestablesnoneQueues
previews.protectionstringsypniaPreview access
release.auto_rollbacktableoffAutomatic rollback
telemetryboolean or tablefalseSend logs and traces to Sypnia Telemetry
use_casesstringnoneThe folder of the use-case map ("cases"), or "sypnorm" to build it from the code (Use cases)
cases.splittablesnoneCases that get a service of their own, with memory, timeout, runtime, concurrency (How use cases run)
cases.handlerstablenoneFor cases written in another language: the function or container route that runs each one (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
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
[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.

  1. The project
  2. An app: [run.apps.<name>]
  3. Several apps
  4. A container on Fargate

    Search pages, sections and terms