Docker Compose provides the simplest way to run GoRules BRMS with a PostgreSQL database.
Prerequisites
- Docker installed
- Docker Compose v2+
Quick start
Create a docker-compose.yml file:
version: '3.8'
services:
brms:
image: gorules/brms
ports:
- '9080:80'
depends_on:
- postgres
environment:
DB_HOST: postgres
DB_PORT: 5432
DB_USER: gorules
DB_PASSWORD: your-secure-password
DB_NAME: gorules
DB_SSL_DISABLED: true
LICENSE_KEY: your-license-key
postgres:
image: postgres:15
environment:
POSTGRES_USER: gorules
POSTGRES_PASSWORD: your-secure-password
POSTGRES_DB: gorules
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- '5432:5432'
volumes:
postgres_data:
Start the services:
Access BRMS at http://localhost:9080.
Scaling
For multiple BRMS instances:
services:
brms:
image: gorules/brms
deploy:
replicas: 3
# ... rest of config
Use with a load balancer or Docker Swarm for production scaling.
Backup
Backup the PostgreSQL volume:
# Stop services
docker-compose stop
# Backup volume
docker run --rm \
-v gorules_postgres_data:/data \
-v $(pwd):/backup \
alpine tar czf /backup/postgres-backup.tar.gz -C /data .
# Restart services
docker-compose start
Upgrade
Update to the latest version:
# Pull latest image
docker-compose pull
# Recreate with new image
docker-compose up -d
The BRMS automatically runs database migrations on startup.
Troubleshooting
Container won’t start
Check logs:
Common issues:
- Invalid
LICENSE_KEY
- Database connection failed
- Missing required environment variables
Database connection errors
Verify PostgreSQL is healthy:
docker-compose exec postgres pg_isready -U gorules
Reset everything
Remove all data and start fresh:
docker-compose down -v
docker-compose up -d
This deletes all data including the PostgreSQL volume.