{
  "manifest_version": "1.0.0",
  "template": {
    "id": "eae87461-43b7-4d6e-a24e-756179d73dca",
    "slug": "blue-dark",
    "name": "Bifrost + PostgreSQL",
    "description": "Deploy Bifrost AI Gateway with PostgreSQL — production-ready in one click.",
    "url": "https://railway.com/deploy/blue-dark",
    "upstream": {
      "image": "maximhq/bifrost:latest"
    }
  },
  "services": [
    {
      "name": "maximhq/bifrost:latest",
      "source": {
        "image": "maximhq/bifrost:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/data",
      "http": true
    },
    {
      "name": "railwayapp-templates/postgres-ssl:18",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "APP_HOST",
      "service": "maximhq/bifrost:latest",
      "description": "Provide a value for APP_HOST.",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "APP_PORT",
      "service": "maximhq/bifrost:latest",
      "description": "Provide a value for APP_PORT.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "LOG_LEVEL",
      "service": "maximhq/bifrost:latest",
      "description": "Provide a value for LOG_LEVEL.",
      "secret": false,
      "strategy": "default",
      "default": "info"
    },
    {
      "key": "LOG_STYLE",
      "service": "maximhq/bifrost:latest",
      "description": "Provide a value for LOG_STYLE.",
      "secret": false,
      "strategy": "default",
      "default": "json"
    },
    {
      "key": "BIFROST_CONFIG",
      "service": "maximhq/bifrost:latest",
      "description": "Provide a value for BIFROST_CONFIG.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "maximhq/bifrost:latest",
      "description": "Provide a value for RAILWAY_RUN_UID.",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "PGDATA",
      "service": "railwayapp-templates/postgres-ssl:18",
      "description": "Provide a value for PGDATA.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "railwayapp-templates/postgres-ssl:18",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "default",
      "default": "bifrost"
    },
    {
      "key": "POSTGRES_USER",
      "service": "railwayapp-templates/postgres-ssl:18",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "default",
      "default": "bifrost"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "railwayapp-templates/postgres-ssl:18",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "blue-dark"
      }
    },
    "cli": "railway deploy --template blue-dark",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "eae87461-43b7-4d6e-a24e-756179d73dca",
            "serializedConfig": {
              "services": {
                "1272d7a9-827a-4105-8427-528c0d09abc0": {
                  "icon": "https://framerusercontent.com/images/k49dViw06yckDjJt5uERdfTSjU.png",
                  "name": "maximhq/bifrost:latest",
                  "deploy": {
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 3
                  },
                  "source": {
                    "image": "maximhq/bifrost:latest",
                    "autoUpdates": {
                      "type": "patch",
                      "schedule": [
                        {
                          "day": 0,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 1,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 2,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 3,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 4,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 5,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 6,
                          "endHour": 6,
                          "startHour": 2
                        }
                      ]
                    }
                  },
                  "variables": {
                    "APP_HOST": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "0.0.0.0"
                    },
                    "APP_PORT": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "8080"
                    },
                    "LOG_LEVEL": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "info"
                    },
                    "LOG_STYLE": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "json"
                    },
                    "BIFROST_CONFIG": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "{\"config_store\":{\"enabled\":true,\"type\":\"postgres\",\"config\":{\"host\":\"${{Postgres.PGHOST}}\",\"port\":\"${{Postgres.PGPORT}}\",\"user\":\"${{Postgres.PGUSER}}\",\"password\":\"${{Postgres.PGPASSWORD}}\",\"db_name\":\"${{Postgres.PGDATABASE}}\",\"ssl_mode\":\"disable\"}},\"logs_store\":{\"enabled\":true,\"type\":\"postgres\",\"config\":{\"host\":\"${{Postgres.PGHOST}}\",\"port\":\"${{Postgres.PGPORT}}\",\"user\":\"${{Postgres.PGUSER}}\",\"password\":\"${{Postgres.PGPASSWORD}}\",\"db_name\":\"${{Postgres.PGDATABASE}}\",\"ssl_mode\":\"disable\"}}}"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "0"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  },
                  "volumeMounts": {
                    "1272d7a9-827a-4105-8427-528c0d09abc0": {
                      "mountPath": "/app/data"
                    }
                  }
                },
                "df3e12e3-8dab-4e3d-935b-6a661766aedd": {
                  "icon": "https://wiki.postgresql.org/images/a/a4/PostgreSQL_logo.3colors.svg",
                  "name": "railwayapp-templates/postgres-ssl:18",
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18",
                    "autoUpdates": {
                      "type": "patch",
                      "schedule": [
                        {
                          "day": 0,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 1,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 2,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 3,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 4,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 5,
                          "endHour": 6,
                          "startHour": 2
                        },
                        {
                          "day": 6,
                          "endHour": 6,
                          "startHour": 2
                        }
                      ]
                    }
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "bifrost"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "bifrost"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "df3e12e3-8dab-4e3d-935b-6a661766aedd": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  },
                  "haTemplateCode": "postgres-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxy",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "Routes traffic to the primary",
                      "defaultValue": 3
                    },
                    "replica": {
                      "label": "Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "nodeLabel": "Postgres",
                      "description": "Streaming replicas for automatic failover",
                      "defaultValue": 2
                    },
                    "internal": {
                      "label": "Coordinator Nodes",
                      "options": [
                        3,
                        5,
                        7,
                        9
                      ],
                      "nodeLabel": "etcd",
                      "defaultValue": 3
                    },
                    "description": "This will convert your Postgres database to an HA cluster with Patroni failover and etcd consensus."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "maximhq/bifrost:latest",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-22T16:14:56.866Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T10:28:05.406Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_c1b8388bb62f4ababd16",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 77,
    "typical_build_seconds": 0,
    "typical_start_seconds": 11,
    "slowest_service": "maximhq/bifrost:latest"
  }
}
