{
  "manifest_version": "1.0.0",
  "template": {
    "id": "9c83098a-1ccc-4307-b7a9-b300edc3eb0e",
    "slug": "kuzzle-or-just-updated-backend-api-with-",
    "name": "Kuzzle | (Just Updated) Backend API with Elasticsearch, Admin Password Generated, Data Survives Redeploys",
    "description": "Kuzzle backend API with Elasticsearch and Redis, secrets generated",
    "url": "https://railway.com/deploy/kuzzle-or-just-updated-backend-api-with-",
    "upstream": {
      "image": "kuzzleio/kuzzle@sha256:e35ef299f221ce3ef0f90cf7b656ea55ad22df947fe1b177cd342c76d1766603"
    }
  },
  "services": [
    {
      "name": "elasticsearch",
      "source": {
        "image": "elasticsearch:8.19.5@sha256:767258226c972b46c0c22817c16a9d7f40a90f67ec71fdc33f3c831c8eecdd6e"
      },
      "needs_volume": true,
      "volume_mount_path": "/usr/share/elasticsearch/data",
      "http": false
    },
    {
      "name": "redis",
      "source": {
        "image": "redis:8@sha256:2c2dff791878316e3b083188be0d578423b24813cdda5de0e80ea4f7b3e6bfd6"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "kuzzle",
      "source": {
        "image": "kuzzleio/kuzzle@sha256:e35ef299f221ce3ef0f90cf7b656ea55ad22df947fe1b177cd342c76d1766603"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "RAILWAY_RUN_UID",
      "service": "elasticsearch",
      "description": "Provide a value for RAILWAY_RUN_UID.",
      "secret": false,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "redis",
      "description": "Provide a value for REDIS_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "KUZZLE_ADMIN_PASSWORD",
      "service": "kuzzle",
      "description": "Provide a value for KUZZLE_ADMIN_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "kuzzle_security__authToken__secret",
      "service": "kuzzle",
      "description": "Provide a value for kuzzle_security__authToken__secret.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "kuzzle_services__internalCache__node__host",
      "service": "kuzzle",
      "description": "Provide a value for kuzzle_services__internalCache__node__host.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "kuzzle_services__memoryStorage__node__host",
      "service": "kuzzle",
      "description": "Provide a value for kuzzle_services__memoryStorage__node__host.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "kuzzle_services__storageEngine__client__node",
      "service": "kuzzle",
      "description": "Provide a value for kuzzle_services__storageEngine__client__node.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "kuzzle_services__internalCache__node__password",
      "service": "kuzzle",
      "description": "Provide a value for kuzzle_services__internalCache__node__password.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "kuzzle_services__memoryStorage__node__password",
      "service": "kuzzle",
      "description": "Provide a value for kuzzle_services__memoryStorage__node__password.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "kuzzle-or-just-updated-backend-api-with-"
      }
    },
    "cli": "railway deploy --template kuzzle-or-just-updated-backend-api-with-",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "9c83098a-1ccc-4307-b7a9-b300edc3eb0e",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "24997f57-3774-48f8-adab-b9575e364b44": {
                  "icon": null,
                  "name": "elasticsearch",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'export ES_JAVA_OPTS=\"-Xms512m -Xmx512m\" JAVA_TOOL_OPTIONS=-XX:ActiveProcessorCount=2; mkdir -p /usr/share/elasticsearch/data/es && chown -R 1000:0 /usr/share/elasticsearch/data && exec setpriv --reuid=1000 --regid=0 --clear-groups /usr/local/bin/docker-entrypoint.sh eswrapper -Ediscovery.type=single-node -Expack.security.enabled=false -Epath.data=/usr/share/elasticsearch/data/es -Enetwork.host=\\\"::\\\"'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "elasticsearch:8.19.5@sha256:767258226c972b46c0c22817c16a9d7f40a90f67ec71fdc33f3c831c8eecdd6e"
                  },
                  "variables": {
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "defaultValue": "{{RAILWAY_RUN_UID}}"
                    }
                  },
                  "volumeMounts": {
                    "24997f57-3774-48f8-adab-b9575e364b44": {
                      "mountPath": "/usr/share/elasticsearch/data"
                    }
                  }
                },
                "3b8be0fe-a879-4641-8198-6a6e8a3f63cc": {
                  "icon": null,
                  "name": "redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'chown -R redis:redis /data && exec docker-entrypoint.sh redis-server --requirepass \"$REDIS_PASSWORD\" --appendonly yes --dir /data'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8@sha256:2c2dff791878316e3b083188be0d578423b24813cdda5de0e80ea4f7b3e6bfd6"
                  },
                  "variables": {
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "3b8be0fe-a879-4641-8198-6a6e8a3f63cc": {
                      "mountPath": "/data"
                    }
                  }
                },
                "a3a44e09-6940-4218-954a-369fac85abe8": {
                  "icon": null,
                  "name": "kuzzle",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'export kuzzle_server__port=$PORT kuzzle_cluster__enabled=false kuzzle_services__storageEngine__majorVersion=8; B=http://localhost:$PORT; (until [ \"$(curl -s -o /dev/null -w %{http_code} $B/_healthCheck)\" != 000 ]; do sleep 2; done; curl -s -X POST \"$B/_createFirstAdmin/admin?reset=true\" -H \"Content-Type: application/json\" -d \"{\\\"content\\\":{},\\\"credentials\\\":{\\\"local\\\":{\\\"username\\\":\\\"admin\\\",\\\"password\\\":\\\"$KUZZLE_ADMIN_PASSWORD\\\"}}}\" >/dev/null; J=$(curl -s -X POST $B/_login/local -H \"Content-Type: application/json\" -d \"{\\\"username\\\":\\\"admin\\\",\\\"password\\\":\\\"$KUZZLE_ADMIN_PASSWORD\\\"}\" | sed -n \"s/.*\\\"jwt\\\":\\\"\\([^\\\"]*\\)\\\".*/\\1/p\"); curl -s -X PUT $B/roles/anonymous -H \"Authorization: Bearer $J\" -H \"Content-Type: application/json\" -d \"{\\\"controllers\\\":{\\\"auth\\\":{\\\"actions\\\":{\\\"login\\\":true,\\\"checkToken\\\":true,\\\"getCurrentUser\\\":true,\\\"getMyRights\\\":true,\\\"logout\\\":true}},\\\"server\\\":{\\\"actions\\\":{\\\"healthCheck\\\":true,\\\"now\\\":true}}}}\" >/dev/null; echo kuzzle bootstrap done) & exec docker-entrypoint.sh node ./bin/start-kuzzle-server'",
                    "healthcheckPath": "/_healthCheck",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "kuzzleio/kuzzle@sha256:e35ef299f221ce3ef0f90cf7b656ea55ad22df947fe1b177cd342c76d1766603"
                  },
                  "variables": {
                    "KUZZLE_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{KUZZLE_ADMIN_PASSWORD}}"
                    },
                    "kuzzle_security__authToken__secret": {
                      "isOptional": false,
                      "defaultValue": "{{kuzzle_security__authToken__secret}}"
                    },
                    "kuzzle_services__internalCache__node__host": {
                      "isOptional": false,
                      "defaultValue": "${{redis.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "kuzzle_services__memoryStorage__node__host": {
                      "isOptional": false,
                      "defaultValue": "${{redis.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "kuzzle_services__storageEngine__client__node": {
                      "isOptional": false,
                      "defaultValue": "http://${{elasticsearch.RAILWAY_PRIVATE_DOMAIN}}:9200"
                    },
                    "kuzzle_services__internalCache__node__password": {
                      "isOptional": false,
                      "defaultValue": "${{redis.REDIS_PASSWORD}}"
                    },
                    "kuzzle_services__memoryStorage__node__password": {
                      "isOptional": false,
                      "defaultValue": "${{redis.REDIS_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "kuzzle",
      "method": "GET",
      "path": "/_healthCheck",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-10-30T04:14:55.026Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-10-19T05:37:59.148Z",
  "success_rate_30d": 0.5,
  "validation": {
    "last_run_id": "run_4809d8873e764e3abf44",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 142,
    "typical_build_seconds": 0,
    "typical_start_seconds": 21,
    "slowest_service": "kuzzle"
  }
}
