Configuration
Environment variables, ports, database credentials, secrets, and volume mounts for the self-hosted stack.
The .env file
All configuration is supplied through a .env file that sits alongside docker-compose.yml. Docker Compose loads it automatically at startup. Variables set here are injected into whichever containers declare env_file: .env.
Ports
These variables control which host ports the containers bind to. Change them if the defaults conflict with services already running on your machine.
| Variable | Default | Description |
|---|---|---|
API_PORT |
8543 |
Host port mapped to the Dreamphase server container. Serves both the HTTP API and the bundled web UI. |
POSTGRES_PORT |
5432 |
Host port mapped to the PostgreSQL container (optional; omit to keep the database off the host network). |
Database credentials
The PostgreSQL container initialises with the credentials you provide here. The Dreamphase server uses the same values to connect via DATABASE_URL, which is composed automatically inside the compose file from these variables.
| Variable | Required | Description |
|---|---|---|
POSTGRES_USER |
Yes | Database superuser name (default dreamer) |
POSTGRES_PASSWORD |
Yes | Database superuser password, use a strong, randomly generated value |
POSTGRES_DB |
Yes | Name of the application database (default dreamphase) |
Application secrets
The Dreamphase server uses an API key to authenticate clients. Provide a cryptographically random value in production.
| Variable | Required | Description |
|---|---|---|
API_KEY |
Yes | API key the Dreamphase server requires from clients, generate with openssl rand -hex 32 and override the changeme default before any non-local use. |
ENVIRONMENT |
No | Runtime mode for the Dreamphase server (default production). |
Web UI
The bundled web UI is served by the dreamphase container on the same port as the HTTP API. There is no separate UI container or UI_PORT, open http://your-host:<API_PORT> in any browser to reach it.
Persistent volume mounts
Data is stored in named Docker volumes so it survives container restarts. The volume names are defined in docker-compose.yml. To inspect or back up the data, use standard Docker volume commands:
# List volumes managed by the stack
docker volume ls
# Inspect a specific volume to find its mount path on the host
docker volume inspect pg_data
docker compose down -v deletes your data
The -v flag removes named volumes. Use plain docker compose down to stop containers while keeping data intact.