services
Web Service
Deploy HTTP APIs, web apps, and backend servers with automatic TLS and health checks.
A web service is any application that listens for HTTP traffic. This includes REST APIs, GraphQL servers, Next.js apps, Django sites, and anything else that responds to web requests.
When to Use#
- REST or GraphQL APIs
- Server-rendered web applications (Next.js, Nuxt, Rails, Django)
- WebSocket servers
- Any service that needs a public URL
Configuration#
runix.yaml
yaml
services:
- name: api
type: web-service
repo: https://github.com/alice/api-server
branch: main
instance: standard
health_check_path: /health
env:
PORT: "3000"
NODE_ENV: productionAvailable Fields#
| Field | Default | Description |
|---|---|---|
| `repo` | — | GitHub repository URL (required) |
| `branch` | `main` | Git branch to deploy |
| `instance` | `starter` | Instance type: starter, standard, pro |
| `build_command` | Auto-detected | Override the build command |
| `start_command` | Auto-detected | Override the start command |
| `health_check_path` | None | HTTP path for health checks (e.g., `/health`) |
| `env` | None | Environment variables as key-value pairs |
How It Works#
- 1.Runix clones your repo and detects the runtime (Node.js, Python, Go, Rust, Java)
- 2.An AI-generated Dockerfile is created based on your project structure
- 3.The Docker image is built and a container starts on your assigned port
- 4.A public subdomain is assigned (e.g., `api-a1b2.runixcloud.dev`)
- 5.TLS is automatically provisioned via Caddy reverse proxy
- 6.Health checks run against your `health_check_path` if configured
Set a `health_check_path` so Runix can verify your service started correctly. If the health check fails, the deployment is marked as failed and the previous version keeps running.
Example: Node.js API#
runix.yaml
yaml
name: my-api
services:
- name: api
type: web-service
repo: https://github.com/alice/express-api
health_check_path: /api/health
env:
PORT: "3000"
DATABASE_URL: "${db.connection_string}"
- name: db
type: postgresqlbash
$ runix deploy
Success! 2 service(s) deployed:
✓ api
✓ db
$ runix status api
NAME TYPE STATUS INSTANCE URL
api web-service running starter api-a1b2.runixcloud.dev