Documentation

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: production

Available Fields#

FieldDefaultDescription
`repo`GitHub repository URL (required)
`branch``main`Git branch to deploy
`instance``starter`Instance type: starter, standard, pro
`build_command`Auto-detectedOverride the build command
`start_command`Auto-detectedOverride the start command
`health_check_path`NoneHTTP path for health checks (e.g., `/health`)
`env`NoneEnvironment variables as key-value pairs

How It Works#

  1. 1.Runix clones your repo and detects the runtime (Node.js, Python, Go, Rust, Java)
  2. 2.An AI-generated Dockerfile is created based on your project structure
  3. 3.The Docker image is built and a container starts on your assigned port
  4. 4.A public subdomain is assigned (e.g., `api-a1b2.runixcloud.dev`)
  5. 5.TLS is automatically provisioned via Caddy reverse proxy
  6. 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: postgresql
bash
$ 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