{
  "$schema": "https://blueprints.servus.run/schema/servus-blueprint-v1.schema.json",
  "schemaVersion": "servus-blueprint/v1",
  "id": "directus",
  "name": "Directus",
  "tagline": "Instant REST & GraphQL API plus no-code studio over SQL",
  "description": "Modern data platform and headless CMS with selectable PostgreSQL or MariaDB storage and optional Redis caching.",
  "category": "cms",
  "tags": [
    "cms",
    "baas",
    "api",
    "graphql"
  ],
  "version": "2026-12-03.1",
  "publisher": "Directus (Servus Blueprint)",
  "icon": "directus",
  "homepage": "https://directus.io",
  "docsUrl": "https://docs.directus.io",
  "sourceUrl": "https://github.com/directus/directus",
  "license": "BSL-1.1",
  "setup": "Sign in to Directus Studio with the configured administrator email and password.",
  "inputs": [
    {
      "key": "adminEmail",
      "label": "Administrator email",
      "type": "email",
      "required": true,
      "default": "admin@example.com"
    },
    {
      "key": "adminPassword",
      "label": "Administrator password",
      "description": "Leave blank to auto-generate a secure password.",
      "type": "password",
      "secret": true
    },
    {
      "key": "databaseEngine",
      "label": "Database engine",
      "type": "select",
      "default": "postgres",
      "options": [
        {
          "value": "postgres",
          "label": "PostgreSQL 17"
        },
        {
          "value": "mariadb",
          "label": "MariaDB 11.4"
        }
      ]
    },
    {
      "key": "enableCache",
      "label": "Enable Redis cache service",
      "type": "boolean",
      "default": true,
      "group": "advanced"
    }
  ],
  "secrets": [
    {
      "key": "appKey",
      "format": "uuid",
      "bytes": 16
    },
    {
      "key": "appSecret",
      "format": "base64url",
      "bytes": 32
    },
    {
      "key": "dbPassword",
      "format": "base64url",
      "bytes": 32
    },
    {
      "key": "dbRootPassword",
      "format": "base64url",
      "bytes": 32
    },
    {
      "key": "redisPassword",
      "format": "base64url",
      "bytes": 24
    },
    {
      "key": "generatedAdminPassword",
      "format": "alphanumeric",
      "bytes": 20
    }
  ],
  "domains": [
    {
      "key": "primary",
      "label": "Application domain",
      "service": "app",
      "port": 8055,
      "primary": true
    }
  ],
  "profiles": [
    {
      "id": "compact",
      "label": "Compact",
      "services": {
        "app": {
          "cpus": 0.5,
          "memoryMb": 512
        },
        "postgres": {
          "cpus": 0.5,
          "memoryMb": 256
        },
        "mariadb": {
          "cpus": 0.5,
          "memoryMb": 256
        },
        "cache": {
          "cpus": 0.25,
          "memoryMb": 128
        }
      }
    },
    {
      "id": "standard",
      "label": "Standard",
      "services": {
        "app": {
          "cpus": 1,
          "memoryMb": 768
        },
        "postgres": {
          "cpus": 1,
          "memoryMb": 512
        },
        "mariadb": {
          "cpus": 1,
          "memoryMb": 512
        },
        "cache": {
          "cpus": 0.5,
          "memoryMb": 256
        }
      }
    },
    {
      "id": "performance",
      "label": "Performance",
      "services": {
        "app": {
          "cpus": 2,
          "memoryMb": 1536
        },
        "postgres": {
          "cpus": 2,
          "memoryMb": 1024
        },
        "mariadb": {
          "cpus": 2,
          "memoryMb": 1024
        },
        "cache": {
          "cpus": 0.5,
          "memoryMb": 512
        }
      }
    }
  ],
  "defaultProfile": "standard",
  "files": [],
  "volumes": [
    {
      "name": "uploads"
    },
    {
      "name": "extensions"
    },
    {
      "name": "pg_data",
      "when": {
        "input": "databaseEngine",
        "equals": "postgres"
      }
    },
    {
      "name": "maria_data",
      "when": {
        "input": "databaseEngine",
        "equals": "mariadb"
      }
    }
  ],
  "networks": [
    {
      "name": "private",
      "internal": true
    }
  ],
  "services": [
    {
      "name": "app",
      "image": "directus/directus:11.15.4",
      "restart": "unless-stopped",
      "resources": {
        "cpus": 1,
        "memoryMb": 768
      },
      "environment": {
        "KEY": "{{secrets.appKey}}",
        "SECRET": "{{secrets.appSecret}}",
        "PUBLIC_URL": "{{domains.primary.url|http://localhost:8055}}",
        "ADMIN_EMAIL": "{{inputs.adminEmail|admin@example.com}}",
        "ADMIN_PASSWORD": [
          {
            "value": "{{inputs.adminPassword}}",
            "when": {
              "inputTruthy": "adminPassword"
            }
          },
          {
            "value": "{{secrets.generatedAdminPassword}}"
          }
        ],
        "DB_CLIENT": [
          {
            "value": "pg",
            "when": {
              "input": "databaseEngine",
              "equals": "postgres"
            }
          },
          {
            "value": "mysql",
            "when": {
              "input": "databaseEngine",
              "equals": "mariadb"
            }
          }
        ],
        "DB_HOST": [
          {
            "value": "postgres",
            "when": {
              "input": "databaseEngine",
              "equals": "postgres"
            }
          },
          {
            "value": "mariadb",
            "when": {
              "input": "databaseEngine",
              "equals": "mariadb"
            }
          }
        ],
        "DB_PORT": [
          {
            "value": "5432",
            "when": {
              "input": "databaseEngine",
              "equals": "postgres"
            }
          },
          {
            "value": "3306",
            "when": {
              "input": "databaseEngine",
              "equals": "mariadb"
            }
          }
        ],
        "DB_DATABASE": "directus",
        "DB_USER": "directus",
        "DB_PASSWORD": "{{secrets.dbPassword}}",
        "CACHE_ENABLED": {
          "value": "true",
          "when": {
            "inputTruthy": "enableCache"
          }
        },
        "CACHE_STORE": {
          "value": "redis",
          "when": {
            "inputTruthy": "enableCache"
          }
        },
        "REDIS": {
          "value": "redis://default:{{secrets.redisPassword}}@cache:6379",
          "when": {
            "inputTruthy": "enableCache"
          }
        }
      },
      "volumes": [
        {
          "volume": "uploads",
          "target": "/directus/uploads"
        },
        {
          "volume": "extensions",
          "target": "/directus/extensions"
        }
      ],
      "networks": [
        "private"
      ],
      "dependsOn": [
        "postgres",
        "mariadb",
        "cache"
      ],
      "expose": [
        8055
      ]
    },
    {
      "name": "postgres",
      "image": "postgres:17-alpine",
      "restart": "unless-stopped",
      "resources": {
        "cpus": 1,
        "memoryMb": 512
      },
      "when": {
        "input": "databaseEngine",
        "equals": "postgres"
      },
      "environment": {
        "POSTGRES_DB": "directus",
        "POSTGRES_USER": "directus",
        "POSTGRES_PASSWORD": "{{secrets.dbPassword}}"
      },
      "volumes": [
        {
          "volume": "pg_data",
          "target": "/var/lib/postgresql/data"
        }
      ],
      "networks": [
        "private"
      ]
    },
    {
      "name": "mariadb",
      "image": "mariadb:11.4.13",
      "restart": "unless-stopped",
      "resources": {
        "cpus": 1,
        "memoryMb": 512
      },
      "when": {
        "input": "databaseEngine",
        "equals": "mariadb"
      },
      "environment": {
        "MARIADB_DATABASE": "directus",
        "MARIADB_USER": "directus",
        "MARIADB_PASSWORD": "{{secrets.dbPassword}}",
        "MARIADB_ROOT_PASSWORD": "{{secrets.dbRootPassword}}"
      },
      "volumes": [
        {
          "volume": "maria_data",
          "target": "/var/lib/mysql"
        }
      ],
      "networks": [
        "private"
      ]
    },
    {
      "name": "cache",
      "image": "redis:7.4-alpine",
      "restart": "unless-stopped",
      "resources": {
        "cpus": 0.5,
        "memoryMb": 256
      },
      "when": {
        "inputTruthy": "enableCache"
      },
      "command": [
        "redis-server",
        "--requirepass",
        "{{secrets.redisPassword}}"
      ],
      "networks": [
        "private"
      ]
    }
  ]
}
