{
  "manifest_version": "1.0.0",
  "template": {
    "id": "bb6778d7-e21b-44be-a125-e6bf9141ee85",
    "slug": "apache-tika",
    "name": "Apache Tika",
    "description": "Apache Tika 4.0 server for text extraction and OCR behind an API token.",
    "url": "https://railway.com/deploy/apache-tika",
    "upstream": {
      "image": "caddy:2.11.4-alpine"
    }
  },
  "services": [
    {
      "name": "gateway",
      "source": {
        "image": "caddy:2.11.4-alpine"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "tika",
      "source": {
        "image": "apache/tika:4.0.0-1-full"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "gateway",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "TIKA_URL",
      "service": "gateway",
      "description": "Provide a value for TIKA_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "CADDYFILE",
      "service": "gateway",
      "description": "Provide a value for CADDYFILE.",
      "secret": false,
      "strategy": "default",
      "default": "{\n\tadmin off\n\tauto_https off\n}\n\n:{$PORT} {\n\thandle /healthz {\n\t\trespond ok 200\n\t}\n\n\t@authorized header Authorization `Bearer {$TIKA_API_TOKEN}`\n\thandle @authorized {\n\t\trequest_body {\n\t\t\tmax_size {$TIKA_MAX_UPLOAD}\n\t\t}\n\t\treverse_proxy {$TIKA_UPSTREAM} {\n\t\t\theader_up -Authorization\n\t\t}\n\t}\n\n\thandle {\n\t\trespond Unauthorized 401\n\t}\n}"
    },
    {
      "key": "TIKA_UPSTREAM",
      "service": "gateway",
      "description": "Provide a value for TIKA_UPSTREAM.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "TIKA_API_TOKEN",
      "service": "gateway",
      "description": "Provide a value for TIKA_API_TOKEN.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "TIKA_MAX_UPLOAD",
      "service": "gateway",
      "description": "Provide a value for TIKA_MAX_UPLOAD.",
      "secret": false,
      "strategy": "default",
      "default": "100MB"
    },
    {
      "key": "PORT",
      "service": "tika",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "9998"
    },
    {
      "key": "TIKA_PRIVATE_URL",
      "service": "tika",
      "description": "Provide a value for TIKA_PRIVATE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "apache-tika"
      }
    },
    "cli": "railway deploy --template apache-tika",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "bb6778d7-e21b-44be-a125-e6bf9141ee85",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "1a916952-d292-48c0-9c62-7e118e1d8e4c": {
                  "icon": "https://raw.githubusercontent.com/caddyserver/website/5c921006aae4feb2184782ae528c2bb09a07e04f/src/resources/images/favicon.png",
                  "name": "gateway",
                  "deploy": {
                    "startCommand": "sh -c 'printf \"%s\\n\" \"$CADDYFILE\" > /tmp/Caddyfile && exec caddy run --config /tmp/Caddyfile --adapter caddyfile'",
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "caddy:2.11.4-alpine"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "defaultValue": "8080"
                    },
                    "TIKA_URL": {
                      "isOptional": false,
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "CADDYFILE": {
                      "isOptional": false,
                      "defaultValue": "{\n\tadmin off\n\tauto_https off\n}\n\n:{$PORT} {\n\thandle /healthz {\n\t\trespond ok 200\n\t}\n\n\t@authorized header Authorization `Bearer {$TIKA_API_TOKEN}`\n\thandle @authorized {\n\t\trequest_body {\n\t\t\tmax_size {$TIKA_MAX_UPLOAD}\n\t\t}\n\t\treverse_proxy {$TIKA_UPSTREAM} {\n\t\t\theader_up -Authorization\n\t\t}\n\t}\n\n\thandle {\n\t\trespond Unauthorized 401\n\t}\n}"
                    },
                    "TIKA_UPSTREAM": {
                      "isOptional": false,
                      "defaultValue": "${{tika.RAILWAY_PRIVATE_DOMAIN}}:9998"
                    },
                    "TIKA_API_TOKEN": {
                      "isOptional": false,
                      "defaultValue": "{{TIKA_API_TOKEN}}"
                    },
                    "TIKA_MAX_UPLOAD": {
                      "isOptional": false,
                      "defaultValue": "100MB"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                },
                "377b6dfd-3aac-4178-b0dd-e58303bc3830": {
                  "icon": "https://github.com/apache.png",
                  "name": "tika",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/version",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "apache/tika:4.0.0-1-full"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "defaultValue": "9998"
                    },
                    "TIKA_PRIVATE_URL": {
                      "isOptional": false,
                      "defaultValue": "http://${{RAILWAY_PRIVATE_DOMAIN}}:9998"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "gateway",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": false
  },
  "generated_at": "2026-09-24T04:14:44.625Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-24T01:17:03.854Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_6811f01ed84f46f688e8",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 114,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "gateway"
  }
}
