Environment Variables
Docker Compose uses .env in the asp-compose/ directory. On first initialization, init.sh creates it from .env.example and generates random Django, PostgreSQL, Redis, and RustFS credentials.
Apply changes with:
docker compose up -d
./scripts/doctor.shProtect .env
.env contains service passwords and secrets. Restrict access and never commit it.
Images
| Variable | Default | Description |
|---|---|---|
ASP_BACKEND_IMAGE | Current backend image | Used by backend, Worker, and migration services. |
ASP_FRONTEND_IMAGE | Current frontend image | Used by the HTTPS entrypoint and frontend. |
The upgrade script updates both variables from the latest release package.
HTTPS entrypoint
| Variable | Default | Description |
|---|---|---|
ASP_BIND | 0.0.0.0 | Host bind address. |
ASP_HTTPS_PORT | 443 | Host HTTPS port. |
ASP_PUBLIC_HOSTNAME | localhost | CN and SAN used only for the fallback self-signed certificate. |
ASP_CERT_EXTRA_SAN | Empty | Extra SAN entries, such as DNS:asp.example.com,IP:10.0.0.10. |
ASP_MAX_UPLOAD_SIZE | 20m | Maximum request body accepted by Nginx. |
Certificate hostname settings apply only when certs/asp.crt and certs/asp.key do not exist.
Web API
| Variable | Default | Description |
|---|---|---|
ASP_WEB_WORKERS | 3 | Gunicorn worker processes. |
ASP_WEB_THREADS | 4 | Threads per worker. |
ASP_WEB_TIMEOUT | 210 | Request timeout in seconds; Nginx derives its proxy timeout from it. |
ASP_WEB_KEEPALIVE | 5 | HTTP keep-alive duration in seconds. |
ASP_WEB_MAX_REQUESTS | 1000 | Requests handled before recycling a worker. |
ASP_WEB_MAX_REQUESTS_JITTER | 100 | Random offset for worker recycling. |
ASP_DOCTOR_WAIT_SECONDS | 180 | Maximum seconds doctor.sh waits for services. |
More workers and threads increase CPU, memory, and PostgreSQL connection usage.
Management UIs
| Variable | Default | Description |
|---|---|---|
ASP_MANAGEMENT_BIND | 0.0.0.0 | Host bind address for both management UIs. |
ASP_REDIS_UI_PORT | 8001 | Redis Stack UI host port. |
ASP_RUSTFS_CONSOLE_PORT | 9001 | RustFS Console host port. |
Restrict production access with a firewall or VPN. See Service Management UIs.
Django
| Variable | Default | Description |
|---|---|---|
DJANGO_SECRET_KEY | Generated | Django signing secret. |
DJANGO_DEBUG | false | Enables Django Debug; keep disabled in production. |
DJANGO_ALLOWED_HOSTS | * | Comma-separated accepted Host values. |
DJANGO_LOG_LEVEL | INFO | Application root log level. |
DJANGO_LOG_LEVEL_DJANGO | INFO | Django framework log level. |
DJANGO_LOG_FORMAT | text | text or json. |
PostgreSQL
Connection
| Variable | Default | Description |
|---|---|---|
POSTGRES_DB | asp | Database name. |
POSTGRES_USER | postgres | Database user. |
POSTGRES_PASSWORD | Generated | Database password. |
POSTGRES_HOST | postgres | Database host used by ASP. |
POSTGRES_PORT | 5432 | Database port used by ASP. |
POSTGRES_CONN_MAX_AGE | 60 | Django persistent connection lifetime in seconds. |
POSTGRES_CONN_HEALTH_CHECKS | true | Checks persistent connections before reuse. |
Server tuning
| Variable | Default | Description |
|---|---|---|
POSTGRES_MAX_CONNECTIONS | 150 | Maximum database connections. |
POSTGRES_SHARED_BUFFERS | 512MB | PostgreSQL shared buffers. |
POSTGRES_EFFECTIVE_CACHE_SIZE | 2GB | Planner estimate of available cache; not a direct allocation. |
POSTGRES_WORK_MEM | 8MB | Memory available per sort or hash operation. |
POSTGRES_MAINTENANCE_WORK_MEM | 256MB | Memory for maintenance operations. |
POSTGRES_CHECKPOINT_COMPLETION_TARGET | 0.9 | Fraction of the checkpoint interval used for writes. |
POSTGRES_RANDOM_PAGE_COST | 1.1 | Planner random page read cost. |
POSTGRES_LOG_MIN_DURATION_STATEMENT | 1000 | Slow-query logging threshold in milliseconds. |
PostgreSQL memory settings are cumulative. Evaluate host memory, connection count, and workload before changing them.
Redis
| Variable | Default | Description |
|---|---|---|
REDIS_HOST | redis-stack | Redis host used by ASP. |
REDIS_PORT | 6379 | Redis port used by ASP. |
REDIS_DB | 1 | Redis logical database used by ASP. |
REDIS_PASSWORD | Generated | Redis password. |
RustFS
| Variable | Default | Description |
|---|---|---|
RUSTFS_ENDPOINT_URL | http://rustfs:9000 | S3-compatible API endpoint used by ASP. |
RUSTFS_ACCESS_KEY | asp | S3-compatible Access Key. |
RUSTFS_SECRET_KEY | Generated | S3-compatible Secret Key. |
RUSTFS_BUCKET | asp | Bucket used for attachments and objects. |
RUSTFS_REGION | us-east-1 | Region used for S3 request signing. |
Changing credentials
After initialization, do not change only the PostgreSQL, Redis, or RustFS password in .env. Existing server credentials do not update automatically.
For credential rotation, change the credential in the service first, then update .env and run docker compose up -d.
Next Steps
- Restart & Operations — Apply settings and check services.
- Service Management UIs — Access Redis Stack UI and RustFS Console.
- Backup & Restore — Back up before important configuration changes.