> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gorules.io/llms.txt
> Use this file to discover all available pages before exploring further.

# BRMS deployment

> Deploy the GoRules BRMS with Docker, Docker Compose, or Kubernetes.

## Docker

Run BRMS with an external PostgreSQL database:

```bash theme={null}
docker run -p 8080:80 \
  -e DB_HOST=your-database-host \
  -e DB_USER=gorules \
  -e DB_PASSWORD=your-password \
  -e DB_NAME=gorules \
  -e LICENSE_KEY=your-license-key \
  gorules/brms
```

## Docker Compose

### Development setup

Complete setup with PostgreSQL included:

```yaml theme={null}
version: '3.8'

services:
  brms:
    image: gorules/brms
    ports:
      - "8080:80"
    environment:
      DB_HOST: postgres
      DB_PORT: 5432
      DB_USER: gorules
      DB_PASSWORD: gorules
      DB_NAME: gorules
      DB_SSL_DISABLED: "true"
      LICENSE_KEY: your-license-key
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:15
    environment:
      POSTGRES_USER: gorules
      POSTGRES_PASSWORD: gorules
      POSTGRES_DB: gorules
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U gorules"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  postgres-data:
```

### Production setup

With SSL, custom SMTP, and external database:

```yaml theme={null}
version: '3.8'

services:
  brms:
    image: gorules/brms
    ports:
      - "443:80"
    environment:
      # Database
      DB_HOST: db.example.com
      DB_PORT: 5432
      DB_USER: gorules
      DB_PASSWORD: ${DB_PASSWORD}
      DB_NAME: gorules
      DB_SSL_CA: ${DB_SSL_CA}

      # Application
      APP_URL: https://rules.example.com
      LICENSE_KEY: ${LICENSE_KEY}

      # Security
      COOKIE_SECRET: ${COOKIE_SECRET}
      SESSION_DURATION_MINUTES: 480

      # Email
      EMAIL_HOST: smtp.sendgrid.net
      EMAIL_PORT: 587
      EMAIL_AUTH_USER: apikey
      EMAIL_AUTH_PASS: ${SENDGRID_API_KEY}
      EMAIL_FROM: noreply@example.com
    restart: unless-stopped
```

## Kubernetes

### Helm chart

The recommended way to deploy on Kubernetes:

```bash theme={null}
# Add the Helm repository
helm repo add gorules https://charts.gorules.io

# Install with custom values
helm install brms gorules/gorules-brms -f values.yaml
```

Download the default values file from [ArtifactHub](https://artifacthub.io/packages/helm/gorules/gorules-brms?modal=values).

### Basic deployment

```yaml theme={null}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gorules-brms
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gorules-brms
  template:
    metadata:
      labels:
        app: gorules-brms
    spec:
      containers:
      - name: brms
        image: gorules/brms:latest
        ports:
        - containerPort: 80
        env:
        - name: DB_HOST
          value: postgres.database.svc.cluster.local
        - name: DB_USER
          valueFrom:
            secretKeyRef:
              name: brms-db-credentials
              key: username
        - name: DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: brms-db-credentials
              key: password
        - name: DB_NAME
          value: gorules
        - name: LICENSE_KEY
          valueFrom:
            secretKeyRef:
              name: brms-license
              key: license-key
        - name: APP_URL
          value: https://rules.example.com
        resources:
          requests:
            memory: "512Mi"
            cpu: "250m"
          limits:
            memory: "1Gi"
            cpu: "1000m"
        livenessProbe:
          httpGet:
            path: /api/health
            port: 80
          initialDelaySeconds: 10
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /api/health
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
  name: gorules-brms
spec:
  selector:
    app: gorules-brms
  ports:
  - port: 80
    targetPort: 80
```

### With ConfigMap and Secrets

```yaml theme={null}
apiVersion: v1
kind: Secret
metadata:
  name: brms-secrets
type: Opaque
stringData:
  db-password: your-db-password
  license-key: your-license-key
  cookie-secret: your-cookie-secret
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: brms-config
data:
  DB_HOST: "postgres.database.svc.cluster.local"
  DB_PORT: "5432"
  DB_USER: "gorules"
  DB_NAME: "gorules"
  APP_URL: "https://rules.example.com"
  SESSION_DURATION_MINUTES: "480"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gorules-brms
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gorules-brms
  template:
    metadata:
      labels:
        app: gorules-brms
    spec:
      containers:
      - name: brms
        image: gorules/brms:latest
        ports:
        - containerPort: 80
        envFrom:
        - configMapRef:
            name: brms-config
        env:
        - name: DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: brms-secrets
              key: db-password
        - name: LICENSE_KEY
          valueFrom:
            secretKeyRef:
              name: brms-secrets
              key: license-key
        - name: COOKIE_SECRET
          valueFrom:
            secretKeyRef:
              name: brms-secrets
              key: cookie-secret
        livenessProbe:
          httpGet:
            path: /api/health
            port: 80
          initialDelaySeconds: 10
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /api/health
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 5
```

### Ingress

```yaml theme={null}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: gorules-brms
  annotations:
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
  tls:
  - hosts:
    - rules.example.com
    secretName: brms-tls
  rules:
  - host: rules.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: gorules-brms
            port:
              number: 80
```

### Multi-architecture clusters

If running mixed architecture node pools, force Linux x86\_64:

```yaml theme={null}
spec:
  template:
    spec:
      nodeSelector:
        kubernetes.io/arch: amd64
        kubernetes.io/os: linux
```

## Serverless deployment

Serverless deployment options (AWS Lambda, Azure Functions, Google Cloud Run) are available as part of the Enterprise plan.

<Card title="Contact us" icon="envelope" href="https://gorules.io/contact-us">
  Get in touch to discuss serverless deployment options
</Card>

## Platform guides

For detailed platform-specific instructions, see:

* [Docker Compose](/developers/platform-guides/docker-compose)
* [Kubernetes](/developers/platform-guides/kubernetes)
* [AWS ECS](/developers/platform-guides/aws-ecs)
* [Azure Container Apps](/developers/platform-guides/azure-container-apps)
