Configuration
go-dims is configured entirely through environment variables. This makes it portable, deployment-friendly, and easy to integrate into Docker, AWS Lambda, or other runtime environments.
There are very few required settings β most are optional and designed to give you control over how images are processed, cached, and served.
π Quick Startβ
You can set configuration values inline when starting the server:
DIMS_SIGNING_KEY="mysecret" DIMS_ERROR_BACKGROUND="#ffffff" ./dims serve
Or define them in an .env
file or through your platformβs configuration system (e.g., Docker
Compose, AWS Lambda environment variables, etc.).
β Required Settingβ
Variable | Description |
---|---|
DIMS_SIGNING_KEY | Secret key used to verify signed URLs. Required. |
π§ Configuration Areasβ
Configuration is organized into logical sections. Each section has its own detailed documentation:
- π General Configuration: Logging, error images, timeouts, and runtime behavior.
- π§ Cache Control: HTTP cache headers like
Cache-Control
,Expires
, andLast-Modified
. - π§ͺ Image Compression: JPEG, PNG, and WebP output tuning.
- π‘ Image Sources: Configure sources like HTTP, S3, and local files.
- π Migrating from mod_dims: Migration guide for mod_dims users.
All values are read once during startup.
Booleans should be set as true
or false
.
Lists (e.g., excluded formats) are comma-separated: DIMS_EXCLUDED_OUTPUT_FORMATS=tiff,gif
If you're deploying go-dims in production, we recommend using environment-specific secrets managers
to safely handle values like DIMS_SIGNING_KEY
.