Docker Deployment
PRISM is distributed as a container image with Chrome and all dependencies pre-installed.
Image
ghcr.io/trident-cache/prism:1.0.0
Quick Start
docker run -d \
--name prism \
-p 4000:4000 \
-v ./prism.toml:/etc/prism/prism.toml:ro \
-v ./license.key:/etc/prism/license.key:ro \
ghcr.io/trident-cache/prism:1.0.0
Docker Compose
version: "3.8"
services:
prism:
image: ghcr.io/trident-cache/prism:1.0.0
ports:
- "4000:4000"
- "9090:9090" # Admin API (optional, bind to localhost in production)
volumes:
- ./prism.toml:/etc/prism/prism.toml:ro
- ./license.key:/etc/prism/license.key:ro
environment:
- RUST_LOG=info
restart: unless-stopped
deploy:
resources:
limits:
memory: 2G
cpus: "2.0"
shm_size: "1g" # Chrome needs shared memory for rendering
security_opt:
- no-new-privileges:true
Environment Variables
| Variable | Description | Default |
|---|---|---|
RUST_LOG | Log level (trace, debug, info, warn, error) | info |
PRISM_CONFIG | Path to config file | /etc/prism/prism.toml |
PRISM_LICENSE | Path to license key file | /etc/prism/license.key |
Volume Mounts
| Container Path | Purpose |
|---|---|
/etc/prism/prism.toml | Configuration file |
/etc/prism/license.key | License key file |
Shared Memory
Chrome requires shared memory (/dev/shm) for rendering. Docker's default 64MB is insufficient and will cause Chrome to crash. Either:
- Set
shm_size: "1g"in your compose file (recommended) - Mount the host's shared memory:
-v /dev/shm:/dev/shm
Resource Limits
Recommended minimums:
| Resource | Minimum | Recommended |
|---|---|---|
| Memory | 1 GB | 2 GB |
| CPU | 1 core | 2 cores |
| Shared Memory | 512 MB | 1 GB |
Each Chrome tab uses approximately 50-150 MB of memory depending on page complexity. With the default 8 tabs, plan for at least 1.5 GB for Chrome alone.
Health Check
Add a health check to your compose file:
services:
prism:
# ...
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9090/healthz"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
Networking
In production, bind the admin API port (9090) to localhost only:
ports:
- "4000:4000" # Proxy - exposed to reverse proxy
- "127.0.0.1:9090:9090" # Admin API - localhost only
If PRISM and your origin run in the same Docker network:
services:
prism:
image: ghcr.io/trident-cache/prism:1.0.0
volumes:
- ./prism.toml:/etc/prism/prism.toml:ro
- ./license.key:/etc/prism/license.key:ro
shm_size: "1g"
networks:
- app
spa:
image: your-spa:latest
networks:
- app
networks:
app:
Then set the origin in your config to the service name:
[server]
origin = "http://spa:3000"