What is a Service?
A service is a running instance of your application code:- Execution Environment - Where your code runs
- Configurable Resources - CPU, memory, and replicas
- Network Accessible - Public (HTTPS/TCP) or private (service discovery)
- Stateless - Use volumes for persistent storage
Containers vs. Functions
| Feature | Container | Function |
|---|---|---|
| Runtime | Any (Docker) | Deno only |
| Language | Any | TypeScript/JavaScript |
| Configuration | Image + tag | Code in editor |
| Setup | Docker build externally | Write code directly |
| AI Assistance | No | Yes (Pro) |
| Flexibility | High | Simple and fast |
| Best For | Full applications, databases | APIs, webhooks, prototypes |
Containers
Containers run Docker images from any registry. They provide maximum flexibility for existing applications in any language or framework. A container’s image comes from one of two sources:- Build from GitHub - Connect a repository so Suga builds the image for you. Each push to the watched branch triggers an automatic rebuild and redeploy.
- Pre-built Image - Pull an existing image from any Docker registry. Best when you already build elsewhere (CI, local Docker, another platform) or are running off-the-shelf images like databases, caches, etc.
Build from GitHub
Connect a GitHub repository and Suga builds the image for you. Pushes to the watched branch trigger an automatic rebuild and redeploy.Install the GitHub App
In the container’s Image section, choose Build from GitHub and install the Suga GitHub App on your account or organization. Grant access to the repositories you want to build from.
Select Repository and Branch
Pick a repository and the branch to watch. Pushes to this branch trigger a new build.
Choose a Build Method
- Dockerfile - point Suga at a
Dockerfilein the repo. - Auto-detect - leave the Dockerfile field empty and Suga reads the repo to generate a build. Works for most Node.js, Python, Go, Ruby, Rust, Java, and PHP projects.
The Suga GitHub App is installed once per account or organization. After installation, any container service can build from the repositories you’ve granted access to.
Build Configuration
Dockerfile builds expose four settings:| Setting | Default | Purpose |
|---|---|---|
| Dockerfile path | Dockerfile | Path to the Dockerfile, relative to the repo root. Set this when your Dockerfile lives in a subdirectory (e.g. apps/api/Dockerfile). |
| Build context | . (repo root) | Directory sent as build context. Narrow it to a sub-path (e.g. apps/api) in monorepos. |
| Target stage | (final stage) | For multi-stage Dockerfiles, build up to a named FROM ... AS <stage> target. |
| Build args | (none) | Key/value pairs passed as --build-arg, available at build time. |
Auto-Build on Push
Auto-build is on by default. Each push to the watched branch:- Builds the configured Dockerfile (or the auto-detected project).
- Tags the image with the commit SHA.
- Rolls out the new image to every environment whose service is wired to that branch.
Pre-built Image
Pull an image from any Docker-compatible registry (Docker Hub, GHCR, GCR, ECR, ACR, or self-hosted) by its full reference:nginx:alpine- Official Nginx from Docker Hubpostgres:16-alpine- PostgreSQL 16ghcr.io/username/myapp:v1.0.0- GitHub Container Registry
Automatic Updates from External Registries
After a pre-built image is deployed, Suga polls the registry for a new digest at the same tag and rolls the service forward when one appears. Useful for:- Mutable tags like
:latest,:stable, or:edge. - External CI pipelines that build outside Suga and push to a tag your service tracks.
Creating a Container
Configure Image
Set the display name, then choose your image source: a Pre-built Image from a registry, or Build from GitHub to build from source.
Supported Registries
Public (no credentials):- Docker Hub:
nginx,postgres,redis - GitHub Container Registry:
ghcr.io/username/image - Quay.io:
quay.io/organization/image
- Docker Hub, GHCR, GCR, ECR, ACR, self-hosted
Suga runs on Linux AMD64. If building on Apple Silicon, use
--platform linux/amd64.Always Pull Latest
For active development with the same tag, force fresh pulls:- Select container → Config tab → Image section
- Check “Always pull image”
- Deploy
Docker Compose Import
Import existing Docker Compose files:- Right-click canvas → “Import Compose”
- Paste YAML or upload file
- Review parsed services
- Import to canvas
Functions
Functions run Deno code. Write TypeScript/JavaScript directly in the dashboard instead of building Docker images.How Functions Work
Functions start an HTTP server on a configured port. Configuration (env vars, resources, networking, replicas) is identical to containers, but you write code in the Code tab instead of specifying an image. There’s no container build for functions. Your TypeScript ships with the deployment and runs on a managed Deno runtime, so changes go live in seconds. That makes functions a good fit for small APIs, webhooks, and quick prototyping.Default Template
New functions use this Hono-based template:Code Editor
Select function → Code tab → write code → Deploy. The editor supports TypeScript syntax highlighting and basic completion.Imports
Environment Variables
AI Assistant (Pro)
Pro plan includes the Vibe AI assistant in the code editor (500,000 tokens/month). It can help you write code, debug issues, and explain concepts.Common Configuration
Both containers and functions share these configuration options:
Resources
Each service is configured with CPU, memory, and replicas. Limits depend on your plan. See Plan Limits for tier maximums, resource pools, volume limits, and the CPU/memory ratio rules.Request Timeout by Plan
Each public HTTPS request is capped at a total time before the gateway returns a timeout response:| Plan | Per-request timeout |
|---|---|
| Free | 15 seconds |
| Pro | No limit |
| Enterprise | No limit |
Networking
Private - Services in the same environment communicate via service names:Environment Variables
Key-value configuration for your services:- Database connection strings
- API keys and secrets (mark as Sensitive)
- Feature flags and settings
Volumes
Persistent storage that survives restarts and redeployments:- Mount paths inside the container
- Size limits vary by plan
- Single-mount only (one service per volume)
Service Templates
Templates provide pre-configured services for common use cases:- PostgreSQL - Database with volume and default credentials
- Redis - Cache with persistence options
- MariaDB - MySQL-compatible database