Services¶
A service is a long-running container image. The runner keeps the service
alive. Traffic reaches the service through the control-plane HTTP proxy at
<slug>.althostproxy.com. The proxy forwards traffic over the runner's tunnel.
Deploying¶
The easiest way is the CLI with an althost.yaml:
services:
api:
image: myorg/api:1.2.3
replicas: 1
memory: 512
node: my-computer # node id or label to run on
althost deploy .
Deploys are idempotent and keyed by service name. The first deploy creates the service. Later deploys update it. When the image (or replicas/memory/node) changes, the system bumps the service version. This tells the runner to restart the service with the new image.
Placement
A service runs on the computer assigned to it (node). Without a node, the
system creates the service but does not schedule it.
Under the hood¶
The runner pulls the image and runs it under the configured container runtime.
It tracks the service as althost-svc-<id>. If the service ships an nginx
config, an nginx container fronts it on a private network. The runner captures
output and streams it back to the control plane as logs (visible in the portal).
WebSockets & streaming¶
Clients can open WebSocket connections to a service through the proxy. The proxy relays the upgrade end-to-end over the tunnel (SSE and streaming responses work the same way). See Architecture.
Logs¶
The runner streams per-service logs to the control plane. The portal shows them
on the service's page. You can also query them at
GET /v1/services/:id/logs?since=<iso>.