High-performance PLDAG constraint database. All-in-one image for logic constraint satisfaction.
1.4K
Oat DB is a high-performance PLDAG (Propositional Logic Directed Acyclic Graph) API database that provides constraint satisfaction solving, graph-based logical operations, and property management.
Perfect for:
This is an all-in-one Docker image - no external dependencies needed!
# Start your own solver api or use pull & run the following
docker run -d --name rust-glpk-api -p 9000:9000 ourstudio/rust-glpk-api
# Pull and run in one command
docker run --name oat-db -p 7061:7061 -e SOLVER_API_URL=http://localhost:9000 -d znittzel/oatdb:latest
# Verify it's running
curl http://localhost:7061/health
# {"status":"healthy"}
That's it! The API is now available at http://localhost:7061
This single container includes everything:
Once running, visit the interactive API documentation:
http://localhost:7061/docs
Create a constraint and solve:
# Create a new constraint node
curl -X POST http://localhost:7061/call \
-H "Content-Type: application/json" \
-d '{
"calls": [
{
"fn": "set_and",
"args": {
"references": ["x", "y", "z"]
},
"out": "constraint_ids"
}
],
"outputs": [
"constraint_ids"
]
}'
# Response: {"id": "abc123..."}
By default, data is ephemeral. To persist data across container restarts:
docker run --name oat-db -p 7061:7061 \
-v oat-data:/data \
-d znittzel/oatdb:latest
All data (Redis + PostgreSQL) is stored in the oat-data volume.
Configure using environment variables:
docker run --name oat-db -p 7061:7061 \
-e LOG_LEVEL=debug \
-e LOG_FORMAT=json \
-e POSTGRES_PASSWORD=my_secure_password \
-v oat-data:/data \
-d znittzel/oatdb:latest
| Variable | Default | Description |
|---|---|---|
PORT | 7061 | API server port |
LOG_LEVEL | info | Log level: error, warn, info, debug, trace |
LOG_FORMAT | compact | Log format: compact, pretty, json |
POSTGRES_PASSWORD | oat_password | PostgreSQL password |
REDIS_PREFIX | pldag: | Prefix for Redis keys |
Note: REDIS_URL and PG_URL are pre-configured for internal services.
The container includes a health check endpoint:
curl http://localhost:7061/health
docker logs -f oat-db
docker exec oat-db supervisorctl status
docker exec -it oat-db /usr/local/bin/test-postgres.sh
docker exec -it oat-db bash
For production deployments:
Change the default PostgreSQL password:
docker run ... -e POSTGRES_PASSWORD=your_secure_password ...
Use structured logging:
docker run ... -e LOG_FORMAT=json ...
Set resource limits:
docker run --memory=2g --cpus=2 ...
Use a reverse proxy (nginx, Caddy, Traefik) for SSL/TLS
Regular backups of the /data volume
# Create backup
docker exec oat-db tar czf /tmp/backup.tar.gz /data
docker cp oat-db:/tmp/backup.tar.gz ./oat-backup-$(date +%Y%m%d).tar.gz
# Stop container
docker stop oat-db
# Restore data
docker run --rm \
-v oat-data:/data \
-v $(pwd):/backup \
ubuntu tar xzf /backup/oat-backup-20240101.tar.gz -C /
# Start container
docker start oat-db
latest - Latest stable release0.2.0 - Specific version0.1.0 - Previous versionLicensed under either of:
If you encounter issues:
docker exec -it oat-db /usr/local/bin/test-postgres.shBuilt with Rust 🦀 • Powered by PostgreSQL, Redis & GLPK
Content type
Image
Digest
sha256:e805c9007…
Size
160.7 MB
Last updated
9 months ago
docker pull znittzel/oatdb