milmilmilmil
Getting Started

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

VariableDefaultPurpose
API_PORT8080Host port the API binds to
WEB_PORT3000Host port the web UI binds to
DATA_DIR./dataHost path mounted into the API at /data
MEDIA_DIR/mnt/mediaHost path mounted into the API at /media (read-only)
DOWNLOAD_DIR./downloadsHost path mounted into the API at /downloads
POSTGRES_USERmilmilPostgres superuser (only used with --profile postgres)
POSTGRES_PASSWORDchange_me_postgres_passwordPostgres password
POSTGRES_DBmilmilPostgres database name

api/.env — runtime secrets

VariableRequiredPurpose
JWT_SECRET✅JWT signing key (≥ 32 chars). Generate with openssl rand -hex 32.
DATABASE_URL✅See Database below
MILMIL_ENCRYPTION_KEYRecommendedAES-256 key for storage credentials. Falls back to JWT_SECRET.
REDIS_URLNoLeave empty for in-memory cache (dev); set redis://redis:6379 in production.
REDIS_USERNAME, REDIS_PASSWORDNoUsed by the Redis container's ACL (not consumed by the API directly).
ADMIN_USER, ADMIN_PASSWORDNoFirst-boot admin auto-provisioning. See First-time Setup.
DANDANPLAY_APP_ID, DANDANPLAY_APP_SECRETNoDandanPlay hash match + danmaku.

See api/.env.example for the full list.

Profiles

docker compose up -d

Starts: api + web + redis (SQLite database — no Postgres).

docker compose --profile postgres up -d

Adds: Postgres 16 container. Set DATABASE_URL=postgres://... in api/.env first.

docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build

Builds images from local source instead of pulling from Docker Hub.

Services

ServicePortImage
milmil-api8080milmildev/milmil-api:latest
milmil-web3000milmildev/milmil-web:latest
redis6379redis:alpine
postgres5432postgres: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}:/downloads

Set 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.db

Reverse proxy

See the dedicated Reverse Proxy guide for Nginx, Caddy, and Traefik configs.

Expected file layout

.env
docker-compose.yml
docker-compose.dev.yml
.env

On this page