Docker Reference
Environment variables, profiles, volumes, and reverse proxy reference for milmil's Docker Compose setup.
For the step-by-step install flow, see Installation. This page is the reference you come back to after you're running.
Env files
milmil splits environment variables into two files:
.env (repo root) — compose-level
| Variable | Default | Purpose |
|---|---|---|
API_PORT | 8080 | Host port the API binds to |
WEB_PORT | 3000 | Host port the web UI binds to |
DATA_DIR | ./data | Host path mounted into the API at /data |
MEDIA_DIR | /mnt/media | Host path mounted into the API at /media (read-only) |
DOWNLOAD_DIR | ./downloads | Host path mounted into the API at /downloads |
POSTGRES_USER | milmil | Postgres superuser (only used with --profile postgres) |
POSTGRES_PASSWORD | change_me_postgres_password | Postgres password |
POSTGRES_DB | milmil | Postgres database name |
api/.env — runtime secrets
| Variable | Required | Purpose |
|---|---|---|
JWT_SECRET | ✅ | JWT signing key (≥ 32 chars). Generate with openssl rand -hex 32. |
DATABASE_URL | ✅ | See Database below |
MILMIL_ENCRYPTION_KEY | Recommended | AES-256 key for storage credentials. Falls back to JWT_SECRET. |
REDIS_URL | No | Leave empty for in-memory cache (dev); set redis://redis:6379 in production. |
REDIS_USERNAME, REDIS_PASSWORD | No | Used by the Redis container's ACL (not consumed by the API directly). |
ADMIN_USER, ADMIN_PASSWORD | No | First-boot admin auto-provisioning. See First-time Setup. |
DANDANPLAY_APP_ID, DANDANPLAY_APP_SECRET | No | DandanPlay hash match + danmaku. |
See api/.env.example for the full list.
Profiles
docker compose up -dStarts: api + web + redis (SQLite database — no Postgres).
docker compose --profile postgres up -dAdds: Postgres 16 container. Set DATABASE_URL=postgres://... in api/.env first.
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --buildBuilds images from local source instead of pulling from Docker Hub.
Services
| Service | Port | Image |
|---|---|---|
milmil-api | 8080 | milmildev/milmil-api:latest |
milmil-web | 3000 | milmildev/milmil-web:latest |
redis | 6379 | redis:alpine |
postgres | 5432 | postgres:16-alpine (opt-in via --profile postgres) |
Volume mounts
The API container expects three mounts:
volumes:
- ${DATA_DIR:-./data}:/data # app data, transcode cache, SQLite DB
- ${MEDIA_DIR:-/mnt/media}:/media:ro # anime library (read-only)
- ${DOWNLOAD_DIR:-./downloads}:/downloadsSet those host paths in .env. The container always uses /data, /media, /downloads internally, so library paths inside milmil should start with /media/....
Database
Zero config, stored at /data/milmil.db. Recommended for single-user setups and small libraries.
DATABASE_URL=sqlite://data/milmil.dbReverse proxy
See the dedicated Reverse Proxy guide for Nginx, Caddy, and Traefik configs.