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

# Docker Configuration

> Docker Compose setup and service configuration.

# Docker Configuration

Nenyax uses Docker Compose to orchestrate all services.

## Two Modes

| Mode           | Command                               | What runs in Docker                                      |
| -------------- | ------------------------------------- | -------------------------------------------------------- |
| **Local dev**  | `docker compose up -d postgres minio` | Only DB + MinIO. You run backend/frontend/agent locally. |
| **All-Docker** | `docker compose up -d --build`        | All 5 services in Docker.                                |

## Services

```yaml theme={null}
services:
  postgres:       # PostgreSQL 16 — port 5434 (host) → 5432 (container)
  minio:          # MinIO object storage — port 9002 (host) → 9000 (container)
  backend:        # FastAPI — port 4201 (depends on postgres)
  agent:          # LiveKit agent (depends on backend)
  frontend:       # Next.js — port 4200 (depends on backend)
```

## Networking

**Local dev** — services connect to Docker containers via host ports:

| From → To             | URL                            |
| --------------------- | ------------------------------ |
| Backend → PostgreSQL  | `localhost:5434`               |
| Backend → MinIO       | `localhost:9002`               |
| Frontend → Backend    | `localhost:8000`               |
| Frontend → PostgreSQL | `localhost:5434` (Better Auth) |

**All-Docker** — services communicate on the internal Docker network:

| From → To                   | URL                         |
| --------------------------- | --------------------------- |
| Backend → PostgreSQL        | `postgres:5432`             |
| Backend → MinIO             | `minio:9000`                |
| Frontend (server) → Backend | `http://backend:8000/api`   |
| Frontend (client) → Backend | `http://localhost:4201/api` |
| Agent → Backend             | `http://backend:8000/api`   |

<Warning>
  In all-Docker mode, the frontend uses two different API URLs:

  * **`INTERNAL_API_URL`** (`http://backend:8000/api`) — used by server components inside Docker
  * **`NEXT_PUBLIC_API_URL`** (`http://localhost:4201/api`) — used by client components in the browser

  Do not remove `INTERNAL_API_URL` from docker-compose.yml — server components cannot reach `localhost:4201` from inside the container.
</Warning>

## Environment

**No `.env` file is required for local dev or Docker dev.** All compose files have defaults:

* `POSTGRES_PASSWORD` defaults to `nenyax`
* `MINIO_ROOT_USER/PASSWORD` defaults to `minioadmin`
* `BETTER_AUTH_SECRET` defaults to `authsecret123`

Create a root `.env` only to override these (e.g., for production credentials).

## Commands

```bash theme={null}
# Local dev — only infrastructure
docker compose up -d postgres minio

# All-Docker — all services
docker compose up -d --build

# View logs
docker compose logs -f

# View logs for one service
docker compose logs -f backend

# Stop all services
docker compose down

# Stop and reset all data
docker compose down -v

# Rebuild one service
docker compose up -d --build backend
```
