# services

> Services by name.

Services by name. A service with `cron` is a scheduled job; one with no `port` and no `cron` is a worker.

- **Type:** map of names to object
- **Since:** manifest v1

## Example

```yaml
services:
  web:
    root: apps/web
    port: 3000
```

## Each entry

A service. Every field is optional; Guv detects what it can. Under `environments.<env>.services` the same fields override the base service for that environment (deep merge).

## Fields

| Field | Type | What it does |
| --- | --- | --- |
| [`description`](/docs/manifest/services/description/) | string | What the service does, shown in the dashboard. |
| [`root`](/docs/manifest/services/root/) | string | Directory of the service in the repository. |
| [`watch`](/docs/manifest/services/watch/) | list of string | Globs of paths that trigger a rebuild on push. |
| [`build`](/docs/manifest/services/build/) | object | How the service is built. |
| [`start`](/docs/manifest/services/start/) | string | Start command. |
| [`pre_deploy`](/docs/manifest/services/pre-deploy/) | string | Command run once per deployment, in a separate VM with the same variables, before traffic moves (for migrations). |
| [`port`](/docs/manifest/services/port/) | integer | Port the app listens on. |
| [`healthcheck`](/docs/manifest/services/healthcheck/) | string or object | How Guv decides a new deployment is healthy before moving traffic. |
| [`domains`](/docs/manifest/services/domains/) | list of [hostname](/docs/manifest/#hostname) or object | Custom domains. |
| [`private`](/docs/manifest/services/private/) | boolean | No public domain; reachable only on the environment's private network as &lt;name>.guv.internal. |
| [`replicas`](/docs/manifest/services/replicas/) | integer or object | Number of copies. |
| [`resources`](/docs/manifest/services/resources/) | object | Limits per replica. |
| [`sleep_when_idle`](/docs/manifest/services/sleep-when-idle/) | boolean | Scale to zero after 10 minutes without requests; the next request wakes it in 1–3 seconds. |
| [`env`](/docs/manifest/services/env/) | [env](/docs/manifest/#env) | Variables for this service. |
| [`volumes`](/docs/manifest/services/volumes/) | list of object | Volumes to mount. |
| [`cron`](/docs/manifest/services/cron/) | string | Five-field cron schedule. |
| [`timezone`](/docs/manifest/services/timezone/) | string | IANA time zone for cron. |
| [`timeout`](/docs/manifest/services/timeout/) | [duration](/docs/manifest/#duration) | Maximum run time of each cron run. |
| [`concurrency_policy`](/docs/manifest/services/concurrency-policy/) | `forbid`, `allow`, `replace` | What to do if a cron run is still going when the next is due. |
| [`restart`](/docs/manifest/services/restart/) | object | Restart behaviour when the process exits. |
| [`overlap`](/docs/manifest/services/overlap/) | [duration](/docs/manifest/#duration) | How long the previous deployment keeps serving after traffic moves. |
| [`auto_rollback`](/docs/manifest/services/auto-rollback/) | boolean | Roll back automatically if a new deployment crash-loops or fails health checks. |
