Docker Deployment
Quick Start
docker pull scramdb/scramdb:latest
docker run -d \
--name scramdb \
-p 5432:5432 \
--cap-add=IPC_LOCK \
--ulimit memlock=-1:-1 \
scramdb/scramdb:latest
Production Configuration
docker run -d \
--name scramdb \
-p 5432:5432 \
--cap-add=IPC_LOCK \
--ulimit memlock=-1:-1 \
-v scramdb-data:/var/lib/scramdb \
-e SCRAMDB_MEMORY_LIMIT=8G \
-e SCRAMDB_WORKERS=8 \
-e SCRAMDB_JIT_ENABLED=true \
--cpus=8 \
--memory=10g \
scramdb/scramdb:latest
Environment Variables
| Variable | Default | Description |
|---|---|---|
SCRAMDB_MEMORY_LIMIT | 4G | Maximum memory for buffer pool and query execution |
SCRAMDB_WORKERS | Auto (cores) | Number of worker threads for parallel execution |
SCRAMDB_JIT_ENABLED | true | Enable JIT compilation |
SCRAMDB_JIT_THRESHOLD | 1 | Number of executions before JIT compilation |
SCRAMDB_PORT | 5432 | PostgreSQL wire protocol port |
SCRAMDB_DATA_DIR | /var/lib/scramdb | Data directory for Tundra storage |
SCRAMDB_WAL_DIR | /var/lib/scramdb/wal | WAL directory |
SCRAMDB_LOG_LEVEL | info | Log level (trace, debug, info, warn, error) |
Volumes
Mount a persistent volume for data durability:
docker volume create scramdb-data
docker run -d \
--name scramdb \
-p 5432:5432 \
--cap-add=IPC_LOCK \
--ulimit memlock=-1:-1 \
-v scramdb-data:/var/lib/scramdb \
scramdb/scramdb:latest
Docker Compose
version: '3.8'
services:
scramdb:
image: scramdb/scramdb:latest
ports:
- "5432:5432"
volumes:
- scramdb-data:/var/lib/scramdb
cap_add:
- IPC_LOCK
ulimits:
memlock: -1
environment:
SCRAMDB_MEMORY_LIMIT: 8G
SCRAMDB_WORKERS: 8
deploy:
resources:
limits:
cpus: '8'
memory: 10G
volumes:
scramdb-data:
Health Check
# Check if ScramDB is accepting connections
pg_isready -h localhost -p 5432