{
  "manifest_version": "1.0.0",
  "template": {
    "id": "46ca294b-0c7c-4b13-a776-ebe7a240bd1b",
    "slug": "opencode-server",
    "name": "Opencode Server",
    "description": "Opencode fully featured server for AI Agents. Web, Server, and CLI mode.",
    "url": "https://railway.com/deploy/opencode-server",
    "upstream": {
      "image": "sprisa/opencode:latest"
    }
  },
  "services": [
    {
      "name": "Opencode Server",
      "source": {
        "image": "sprisa/opencode:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/home/opencode",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Opencode Server",
      "description": "Port for health check",
      "secret": false,
      "strategy": "default",
      "default": "4096"
    },
    {
      "key": "OPENCODE_PORT",
      "service": "Opencode Server",
      "description": "Port to run OpenCode on",
      "secret": false,
      "strategy": "default",
      "default": "4096"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "Opencode Server",
      "description": "Required to mount the Railway volume",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "OPENCODE_USERNAME",
      "service": "Opencode Server",
      "description": "Always opencode user. Not editable",
      "secret": false,
      "strategy": "default",
      "default": "opencode"
    },
    {
      "key": "OPENCODE_CORS_ORIGIN",
      "service": "Opencode Server",
      "description": "Your hosted domain",
      "secret": false,
      "strategy": "default",
      "default": "*"
    },
    {
      "key": "OPENCODE_SERVER_PASSWORD",
      "service": "Opencode Server",
      "description": "Opencode Server Password. Change Me",
      "secret": true,
      "strategy": "default",
      "default": "changeme"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "opencode-server"
      }
    },
    "cli": "railway deploy --template opencode-server",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "46ca294b-0c7c-4b13-a776-ebe7a240bd1b",
            "serializedConfig": {
              "services": {
                "488ec53c-150d-41a8-b064-da7eb2bd28d6": {
                  "icon": "https://pub-6fb5f1860061469da0fd642d6d3a2bbd.r2.dev/opencodelogo2.png",
                  "name": "Opencode Server",
                  "deploy": {
                    "healthcheckPath": "/site.webmanifest",
                    "restartPolicyType": "ALWAYS"
                  },
                  "source": {
                    "image": "sprisa/opencode: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
                        }
                      ],
                      "remediationNotice": null
                    }
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": true,
                      "description": "Port for health check",
                      "defaultValue": "4096"
                    },
                    "OPENCODE_PORT": {
                      "isOptional": true,
                      "description": "Port to run OpenCode on",
                      "defaultValue": "4096"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": true,
                      "description": "Required to mount the Railway volume",
                      "defaultValue": "0"
                    },
                    "OPENCODE_USERNAME": {
                      "isOptional": true,
                      "description": "Always opencode user. Not editable",
                      "defaultValue": "opencode"
                    },
                    "OPENCODE_CORS_ORIGIN": {
                      "isOptional": true,
                      "description": "Your hosted domain",
                      "defaultValue": "*"
                    },
                    "OPENCODE_SERVER_PASSWORD": {
                      "isOptional": false,
                      "description": "Opencode Server Password. Change Me",
                      "defaultValue": "changeme"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:4096": {
                        "port": 4096
                      }
                    }
                  },
                  "volumeMounts": {
                    "488ec53c-150d-41a8-b064-da7eb2bd28d6": {
                      "mountPath": "/home/opencode",
                      "backupSchedules": null
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Opencode Server",
      "method": "GET",
      "path": "/site.webmanifest",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-19T22:14:40.433Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-17T13:43:10.449Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_48bed6d95ab34d2bb26a",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 37,
    "typical_build_seconds": 0,
    "typical_start_seconds": 0,
    "slowest_service": "Opencode Server"
  }
}
