{
  "manifest_version": "1.0.0",
  "template": {
    "id": "e057068c-cfc5-4003-9419-187fa8899c67",
    "slug": "opencode-for-railway",
    "name": "OpenCode for Railway",
    "description": "Pre-configured OpenCode server template for Railway.",
    "url": "https://railway.com/deploy/opencode-for-railway",
    "upstream": {
      "image": "ghcr.io/joeychilson/railway-opencode:2.0"
    }
  },
  "services": [
    {
      "name": "railway-opencode:latest",
      "source": {
        "image": "ghcr.io/joeychilson/railway-opencode:2.0"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/opencode",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "railway-opencode:latest",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "4096"
    },
    {
      "key": "OPENCODE_SERVER_PASSWORD",
      "service": "railway-opencode:latest",
      "description": "Provide a value for OPENCODE_SERVER_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "railway-opencode:latest",
      "description": "Provide a value for RAILWAY_DEPLOYMENT_DRAINING_SECONDS.",
      "secret": false,
      "strategy": "default",
      "default": "30"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "opencode-for-railway"
      }
    },
    "cli": "railway deploy --template opencode-for-railway",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "e057068c-cfc5-4003-9419-187fa8899c67",
            "serializedConfig": {
              "services": {
                "45eb82b2-3ea8-40f1-9e84-fee3aeaae074": {
                  "icon": "https://opencode.ai/_build/assets/opencode-desktop-icon-OSkS5hfD.png",
                  "name": "railway-opencode:latest",
                  "deploy": {
                    "healthcheckPath": "",
                    "restartPolicyType": "ALWAYS"
                  },
                  "source": {
                    "image": "ghcr.io/joeychilson/railway-opencode:2.0",
                    "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": {
                    "PORT": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "4096"
                    },
                    "GITHUB_TOKEN": {
                      "isOptional": true,
                      "description": "",
                      "defaultValue": ""
                    },
                    "GIT_USER_NAME": {
                      "isOptional": true,
                      "description": "",
                      "defaultValue": ""
                    },
                    "GIT_USER_EMAIL": {
                      "isOptional": true,
                      "description": "",
                      "defaultValue": ""
                    },
                    "RAILWAY_API_TOKEN": {
                      "isOptional": true,
                      "description": "",
                      "defaultValue": ""
                    },
                    "OPENCODE_SERVER_PASSWORD": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "{{OPENCODE_SERVER_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "30"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:4096": {
                        "port": 4096
                      }
                    }
                  },
                  "volumeMounts": {
                    "45eb82b2-3ea8-40f1-9e84-fee3aeaae074": {
                      "mountPath": "/var/lib/opencode"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T16:35:59.493Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_1c0864f9c8ab4111995f",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 71,
    "typical_build_seconds": 0,
    "typical_start_seconds": 20,
    "slowest_service": "railway-opencode:latest"
  }
}
