Skip to Content
PyoDocs

pyo.jsonc

Keep a service's settings next to its code.

pyo link writes this file, and pyo deploy applies it. Every setting is optional. What's set here wins, and the rest stays as it is in the dashboard.

Pyo looks in the current folder, then in the folders above it.

The file is JSON with comments and trailing commas:

pyo.jsonc
{
  "$schema": "https://pyo.dev/schema/pyo.json",
  "service": "svc_abc123", // written by pyo link

  // Image services only. A tag or an @sha256 digest.
  "image": "ghcr.io/acme/api:1.2",

  "build": {
    "branch": "main",
    "dockerfilePath": "Dockerfile",
    "context": ".",
    "args": {
      // used on the next deploy
      "RAILPACK_SPA_OUTPUT_DIR": "dist",
    },
  },

  "deploy": {
    "replicas": 2,
    "port": 8080, // the port it listens on for HTTP
    "health": "/healthz", // checked before traffic moves over, or "tcp" or "none"
    "autoRollback": true,
    "serveAs": "static", // a static site's build served as files, or "service"
    "timeout": 300, // seconds a request may take, up to 3600, 0 for no limit
  },

  "resources": {
    "cpu": "500m", // limit: "500m" or "1" (cores)
    "memory": "512Mi", // limit: "512Mi" or "1Gi"
  },

  "env": {
    "LOG_LEVEL": "info",
  },
}

Unknown settings are rejected, so a typo fails instead of being ignored.

With $schema in the file, editors like VS Code complete each setting and explain it as you type.

deploy.timeout is the service's request timeout: how many seconds Pyo Gateway waits for an answer before it returns 504. It's 300 by default, and 0 means no limit. It doesn't close WebSockets.

The file's settings are for the service it's linked to. With -s, a command that names another service leaves them out. See Another service.

Secrets

env is for variables, not secrets, because this file is usually committed. Keep secrets in Pyo:

pyo env set --secret STRIPE_KEY=sk_live_...

Build arguments can end up in the image, so keep secrets out of build.args too.

On this page

Edit page