Skip to main content

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

VariableDescriptionDefault
RUST_LOGLog level (trace, debug, info, warn, error)info
PRISM_CONFIGPath to config file/etc/prism/prism.toml
PRISM_LICENSEPath to license key file/etc/prism/license.key

Volume Mounts

Container PathPurpose
/etc/prism/prism.tomlConfiguration file
/etc/prism/license.keyLicense 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:

ResourceMinimumRecommended
Memory1 GB2 GB
CPU1 core2 cores
Shared Memory512 MB1 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"