{
  "manifest_version": "1.0.0",
  "template": {
    "id": "65874698-aa66-4d88-9c9b-72602246089d",
    "slug": "bifrost-gateway",
    "name": "Bifrost",
    "description": "Self-host Bifrost, the Go AI gateway for 20+ model providers",
    "url": "https://railway.com/deploy/bifrost-gateway",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/bifrost-railway"
    }
  },
  "services": [
    {
      "name": "bifrost",
      "source": {
        "repo": "https://github.com/gridalpha/bifrost-railway"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "bifrost",
      "description": "Port Railway health-checks",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "PG_HOST",
      "service": "bifrost",
      "description": "Private Postgres hostname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PG_USER",
      "service": "bifrost",
      "description": "Scoped database role name",
      "secret": false,
      "strategy": "default",
      "default": "bifrost"
    },
    {
      "key": "APP_PORT",
      "service": "bifrost",
      "description": "Gateway HTTP listen port",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "LOG_STYLE",
      "service": "bifrost",
      "description": "Log format, json or pretty",
      "secret": false,
      "strategy": "default",
      "default": "pretty"
    },
    {
      "key": "S3_BUCKET",
      "service": "bifrost",
      "description": "Bucket holding log payloads",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_ADDR",
      "service": "bifrost",
      "description": "Redis host and port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PG_PASSWORD",
      "service": "bifrost",
      "description": "Password for the scoped role",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "S3_ENDPOINT",
      "service": "bifrost",
      "description": "S3-compatible endpoint URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PG_ADMIN_URL",
      "service": "bifrost",
      "description": "Superuser URL for boot-time setup",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "bifrost",
      "description": "Redis password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "S3_ACCESS_KEY_ID",
      "service": "bifrost",
      "description": "Bucket access key id",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BIFROST_SETUP_TOKEN",
      "service": "bifrost",
      "description": "Bootstrap secret for first admin",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "BIFROST_EXTERNAL_URL",
      "service": "bifrost",
      "description": "Public base URL for MCP OAuth",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "S3_SECRET_ACCESS_KEY",
      "service": "bifrost",
      "description": "Bucket secret access key",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BIFROST_ADMIN_PASSWORD",
      "service": "bifrost",
      "description": "Dashboard admin password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "BIFROST_ADMIN_USERNAME",
      "service": "bifrost",
      "description": "Dashboard admin username",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "BIFROST_ENCRYPTION_KEY",
      "service": "bifrost",
      "description": "Encrypts stored provider keys",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "bifrost",
      "description": "Dockerfile used to build",
      "secret": false,
      "strategy": "default",
      "default": "Dockerfile"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Data directory, a subdirectory of the volume mount",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Private hostname, reachable only inside the project",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Standard PostgreSQL port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "libpq alias of the superuser name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "libpq alias of the default database",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "libpq alias of the superuser password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Default database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "rRAILWAY_PRIVATE_DOMAINailway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private connection string, use this from other services",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Validity window of the generated self-signed TLS certificate",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated superuser password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "Public connection string over the TCP proxy, for external tools",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Grace period for in-flight connections on redeploy",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Private hostname, reachable only inside the project",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Redis",
      "description": "Standard Redis port",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDISUSER",
      "service": "Redis",
      "description": "Default ACL user created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "default"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Private connection string, use this from other services",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Convenience alias of the generated password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Generated password for the default user",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "bifrost-gateway"
      }
    },
    "cli": "railway deploy --template bifrost-gateway",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "65874698-aa66-4d88-9c9b-72602246089d",
            "serializedConfig": {
              "buckets": {
                "5b9f1a8b-8ae9-4a25-8f9e-a3cdcfabaf99": {
                  "name": "bifrost-logs"
                }
              },
              "services": {
                "663f99ea-616b-4542-a3ab-a7adac063e9b": {
                  "icon": "https://raw.githubusercontent.com/maximhq/bifrost/main/docs/favicon.png",
                  "name": "bifrost",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/bifrost-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway health-checks",
                      "defaultValue": "8080"
                    },
                    "PG_HOST": {
                      "isOptional": false,
                      "description": "Private Postgres hostname",
                      "defaultValue": "${{Postgres.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PG_USER": {
                      "isOptional": false,
                      "description": "Scoped database role name",
                      "defaultValue": "bifrost"
                    },
                    "APP_PORT": {
                      "isOptional": false,
                      "description": "Gateway HTTP listen port",
                      "defaultValue": "8080"
                    },
                    "LOG_STYLE": {
                      "isOptional": false,
                      "description": "Log format, json or pretty",
                      "defaultValue": "pretty"
                    },
                    "S3_BUCKET": {
                      "isOptional": false,
                      "description": "Bucket holding log payloads",
                      "defaultValue": "${{bifrost-logs.BUCKET}}"
                    },
                    "REDIS_ADDR": {
                      "isOptional": false,
                      "description": "Redis host and port",
                      "defaultValue": "${{Redis.RAILWAY_PRIVATE_DOMAIN}}:${{Redis.REDISPORT}}"
                    },
                    "PG_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the scoped role",
                      "defaultValue": "{{PG_PASSWORD}}"
                    },
                    "S3_ENDPOINT": {
                      "isOptional": false,
                      "description": "S3-compatible endpoint URL",
                      "defaultValue": "${{bifrost-logs.ENDPOINT}}"
                    },
                    "PG_ADMIN_URL": {
                      "isOptional": false,
                      "description": "Superuser URL for boot-time setup",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Redis password",
                      "defaultValue": "${{Redis.REDISPASSWORD}}"
                    },
                    "S3_ACCESS_KEY_ID": {
                      "isOptional": false,
                      "description": "Bucket access key id",
                      "defaultValue": "${{bifrost-logs.ACCESS_KEY_ID}}"
                    },
                    "BIFROST_SETUP_TOKEN": {
                      "isOptional": false,
                      "description": "Bootstrap secret for first admin",
                      "defaultValue": "{{BIFROST_SETUP_TOKEN}}"
                    },
                    "BIFROST_EXTERNAL_URL": {
                      "isOptional": false,
                      "description": "Public base URL for MCP OAuth",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "S3_SECRET_ACCESS_KEY": {
                      "isOptional": false,
                      "description": "Bucket secret access key",
                      "defaultValue": "${{bifrost-logs.SECRET_ACCESS_KEY}}"
                    },
                    "BIFROST_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Dashboard admin password",
                      "defaultValue": "{{BIFROST_ADMIN_PASSWORD}}"
                    },
                    "BIFROST_ADMIN_USERNAME": {
                      "isOptional": false,
                      "description": "Dashboard admin username",
                      "defaultValue": "admin"
                    },
                    "BIFROST_ENCRYPTION_KEY": {
                      "isOptional": false,
                      "description": "Encrypts stored provider keys",
                      "defaultValue": "{{BIFROST_ENCRYPTION_KEY}}"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Dockerfile used to build",
                      "defaultValue": "Dockerfile"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                },
                "6dcde00f-9431-4f88-8edc-0b8dc1272b05": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data directory, a subdirectory of the volume mount",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Private hostname, reachable only inside the project",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Standard PostgreSQL port",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "libpq alias of the superuser name",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "libpq alias of the default database",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "libpq alias of the superuser password",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Default database created on first boot",
                      "defaultValue": "rRAILWAY_PRIVATE_DOMAINailway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string, use this from other services",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Validity window of the generated self-signed TLS certificate",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated superuser password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "description": "Public connection string over the TCP proxy, for external tools",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Grace period for in-flight connections on redeploy",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "6dcde00f-9431-4f88-8edc-0b8dc1272b05": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "bbbb6b43-920b-4053-89dc-79f12ed17402": {
                  "icon": "https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg",
                  "name": "Redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.2"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "description": "Private hostname, reachable only inside the project",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "description": "Standard Redis port",
                      "defaultValue": "6379"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "description": "Default ACL user created on first boot",
                      "defaultValue": "default"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Private connection string, use this from other services",
                      "defaultValue": "redis://${{REDISUSER}}:${{REDIS_PASSWORD}}@${{REDISHOST}}:${{REDISPORT}}"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "description": "Convenience alias of the generated password",
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated password for the default user",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "bbbb6b43-920b-4053-89dc-79f12ed17402": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-10T17:34:19.670Z",
  "success_rate_30d": 0.5,
  "validation": {
    "last_run_id": "run_d14963ed07b948ffa515",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": false,
        "detail": "Your workspace has been restricted. Please contact support to resolve this."
      }
    ],
    "typical_ready_seconds": 165,
    "typical_build_seconds": 20,
    "typical_start_seconds": 20,
    "slowest_service": "bifrost"
  }
}
