> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archivecircle.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment

> Deploy Eternum with Docker Compose and Cloudflare Tunnel.

Eternum runs as a Docker Compose stack with a Next.js web app, Fastify API, PostgreSQL, Redis, release Redis, and MinIO.

## Services

| Service       | Purpose                                           |
| ------------- | ------------------------------------------------- |
| web           | Next.js app                                       |
| api           | Fastify API and in-process poller                 |
| postgres      | relational database                               |
| redis         | auth blocklist, rate limiting, and app cache      |
| release-redis | volatile beneficiary-bound recovery share storage |
| minio         | encrypted vault blobs and death certificate files |
| cloudflared   | public tunnel ingress                             |

## Common commands

```bash theme={null}
docker compose up -d
docker compose -f docker-compose.prod.yml --env-file .env.production up -d --build
npm run db:migrate
```

## Production notes

<Warning>
  Do not expose PostgreSQL, Redis, release Redis, or MinIO data ports publicly. Production access should go through the web app, API, and controlled admin tools.
</Warning>

<Info>
  The API poller runs in-process with a Redis-backed distributed lock (`SET NX EX`, 40s TTL). Only one instance executes escalation work per 30-second tick, so horizontal scaling of the API is safe.
</Info>
