Skip to content
Configuration

Configuration

np.yaml Reference

# np.yaml — complete reference
version: "1"
project: my-app

services:
  - name: my-service       # Service name (required)
    type: container        # "binary" or "container"
    source: my-image:tag   # Binary path or container image
    port: 8080             # Port to expose
    replicas: 2            # Number of instances
    domain: api.example.com  # (optional) Traefik will auto-route
    runtime: podman        # (optional) "podman" (default) or "docker"
    env:                   # Environment variables
      FOO: bar
      LOG_LEVEL: debug
    resources:             # Per-instance resource limits
      cpu: "200"           # MHz (e.g. 200 = 0.2 core)
      memory: "256"        # MB
    tags:                  # (optional) Arbitrary key-value labels
      - env=staging

Field Reference

Field Required Default Description
name Service name (must be unique within project)
type binary for raw_exec, container for podman/Docker
source Binary path or container image name
port Port to expose via Traefik
replicas 1 Number of instances to run
domain Sets up Traefik routing automatically
runtime podman Container runtime: podman or docker
env Key-value environment variables
resources.cpu 100 CPU MHz per instance
resources.memory 256 Memory MB per instance
tags Arbitrary key=value labels

Container Runtime

np uses Podman as the default container runtime. To use Docker instead:

# Environment variable (global override)
export NP_CONTAINER_RUNTIME=docker

# Per-service override in np.yaml
services:
  - name: legacy-app
    type: container
    source: my-image:latest
    runtime: docker

Minimal Example

version: "1"
services:
  - name: hello
    type: container
    source: nginx:alpine
    port: 80

Full Example

version: "1"
project: my-api

services:
  - name: api
    type: binary
    source: ./api-server
    port: 8080
    replicas: 3
    runtime: podman
    env:
      ENV: production
      PORT: "8080"
    resources:
      cpu: "200"
      memory: "256"
    tags:
      - env=prod
      - team=backend

Next: Commands reference →