Install · Verified

# Docker Compose

static shell

Add the snippet service to your compose file. The token goes on the frontend service, never on api/db/cache — most common split‑stack install miss.

**Start here first.** Every platform recipe below assumes the canonical Express + Docker install at [/install/express-docker](/install/express-docker). The snippets on this page are the platform‑specific deltas on top of that baseline.

Build the canonical Dockerfile and add the service to your compose file. The token goes on the **frontend** service, never on api / db / cache.

docker-compose.ymlcopy

```yaml
# docker-compose.yml
services:
  frontend:
    build: .
    image: yoursite-frontend
    ports: ['3000:3000']
    environment:
      AGENTSITE_TOKEN: ${AGENTSITE_TOKEN}   # ← here, not on api/db
      AGENTSITE_SITE: https://yoursite.com
    restart: unless-stopped

  # Your other services (api, db, cache…) — do NOT add AGENTSITE_TOKEN here.
  api:
    image: yoursite-api
    # ...
```

**Most common install miss in split stacks.** The token gets injected next to the DB password by reflex, the SPA pod runs without it, and agentsite degrades silently to shell‑only. The dashboard usage tab is the fastest way to notice.