{
  "manifest_version": "1.0.0",
  "template": {
    "id": "d5a50f82-4e23-4c94-8249-d461596ca221",
    "slug": "opencode-1",
    "name": "OpenCode",
    "description": "OpenCode AI Pro Stack: Open Code WebUI, terminal, Git and persistent files.",
    "url": "https://railway.com/deploy/opencode-1",
    "upstream": {
      "repo_url": "https://github.com/XavTo/OpenCode-Railway"
    }
  },
  "services": [
    {
      "name": "OpenCode",
      "source": {
        "repo": "https://github.com/XavTo/OpenCode-Railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "OpenCode",
      "description": "Public HTTP port. Keep 8080 unless you also update the domain target port.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "OpenCode",
      "description": "Initialize volume ownership as root, then run OpenCode and Caddy as UID 1000. Keep 0.",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "OPENCODE_SERVER_PASSWORD",
      "service": "OpenCode",
      "description": "Unique generated password for the web app and API. Reveal it after deployment to sign in.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "OPENCODE_SERVER_USERNAME",
      "service": "OpenCode",
      "description": "Username for the OpenCode web app and API. Default: opencode.",
      "secret": false,
      "strategy": "default",
      "default": "opencode"
    },
    {
      "key": "OPENCODE_DISABLE_AUTOUPDATE",
      "service": "OpenCode",
      "description": "Keep true to use the tested, versioned OpenCode binary supplied by this template.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "OpenCode",
      "description": "Allow 30 seconds for OpenCode to finish shutting down before the container is stopped.",
      "secret": false,
      "strategy": "default",
      "default": "30"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "opencode-1"
      }
    },
    "cli": "railway deploy --template opencode-1",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "d5a50f82-4e23-4c94-8249-d461596ca221",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "9f242827-1528-4c91-9955-cac85b4526b3": {
                  "icon": "https://opencode.ai/favicon.svg",
                  "name": "OpenCode",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 5
                  },
                  "source": {
                    "repo": "https://github.com/XavTo/OpenCode-Railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Public HTTP port. Keep 8080 unless you also update the domain target port.",
                      "defaultValue": "8080"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Initialize volume ownership as root, then run OpenCode and Caddy as UID 1000. Keep 0.",
                      "defaultValue": "0"
                    },
                    "OPENCODE_SERVER_PASSWORD": {
                      "isOptional": false,
                      "description": "Unique generated password for the web app and API. Reveal it after deployment to sign in.",
                      "defaultValue": "{{OPENCODE_SERVER_PASSWORD}}"
                    },
                    "OPENCODE_SERVER_USERNAME": {
                      "isOptional": false,
                      "description": "Username for the OpenCode web app and API. Default: opencode.",
                      "defaultValue": "opencode"
                    },
                    "OPENCODE_DISABLE_AUTOUPDATE": {
                      "isOptional": false,
                      "description": "Keep true to use the tested, versioned OpenCode binary supplied by this template.",
                      "defaultValue": "true"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Allow 30 seconds for OpenCode to finish shutting down before the container is stopped.",
                      "defaultValue": "30"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  },
                  "volumeMounts": {
                    "9f242827-1528-4c91-9955-cac85b4526b3": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "OpenCode",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-10-16T10:14:44.004Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-10-16T08:30:24.354Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_c1f9e471a69e41a5aeec",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 68,
    "typical_build_seconds": 30,
    "typical_start_seconds": 20,
    "slowest_service": "OpenCode"
  }
}
