{
  "manifest_version": "1.0.0",
  "template": {
    "id": "f1b93fcf-0063-45ac-ae87-76579e2827b1",
    "slug": "grist-1",
    "name": "Grist",
    "description": "Grist 1.7: relational spreadsheet with Python formulas and REST API.",
    "url": "https://railway.com/deploy/grist-1",
    "upstream": {
      "image": "caddy:2.11.4-alpine"
    }
  },
  "services": [
    {
      "name": "grist",
      "source": {
        "image": "gristlabs/grist:1.7.19"
      },
      "needs_volume": true,
      "volume_mount_path": "/persist",
      "http": false
    },
    {
      "name": "gateway",
      "source": {
        "image": "caddy:2.11.4-alpine"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "grist",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "8484"
    },
    {
      "key": "APP_HOME_URL",
      "service": "grist",
      "description": "Provide a value for APP_HOME_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "GRIST_IN_SERVICE",
      "service": "grist",
      "description": "Provide a value for GRIST_IN_SERVICE.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "GRIST_ADMIN_EMAIL",
      "service": "grist",
      "description": "Provide a value for GRIST_ADMIN_EMAIL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "GRIST_FORCE_LOGIN",
      "service": "grist",
      "description": "Provide a value for GRIST_FORCE_LOGIN.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "GRIST_DEFAULT_EMAIL",
      "service": "grist",
      "description": "Provide a value for GRIST_DEFAULT_EMAIL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "GRIST_SANDBOX_FLAVOR",
      "service": "grist",
      "description": "Provide a value for GRIST_SANDBOX_FLAVOR.",
      "secret": false,
      "strategy": "default",
      "default": "pyodide"
    },
    {
      "key": "GRIST_SESSION_SECRET",
      "service": "grist",
      "description": "Provide a value for GRIST_SESSION_SECRET.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "GRIST_TELEMETRY_LEVEL",
      "service": "grist",
      "description": "Provide a value for GRIST_TELEMETRY_LEVEL.",
      "secret": false,
      "strategy": "default",
      "default": "off"
    },
    {
      "key": "GRIST_FORWARD_AUTH_HEADER",
      "service": "grist",
      "description": "Provide a value for GRIST_FORWARD_AUTH_HEADER.",
      "secret": false,
      "strategy": "default",
      "default": "X-Forwarded-User"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "grist",
      "description": "Provide a value for RAILWAY_DEPLOYMENT_DRAINING_SECONDS.",
      "secret": false,
      "strategy": "default",
      "default": "20"
    },
    {
      "key": "PORT",
      "service": "gateway",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "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 /gateway_health {\n\t\trespond ok 200\n\t}\n\n\t# Grist's own health endpoint stays open.\n\thandle /status {\n\t\treverse_proxy {$GRIST_UPSTREAM}\n\t}\n\n\t# Grist API keys go straight to Grist, which validates them itself.\n\t@apikey header_regexp Authorization `^Bearer .+`\n\thandle @apikey {\n\t\treverse_proxy {$GRIST_UPSTREAM} {\n\t\t\theader_up -X-Forwarded-User\n\t\t}\n\t}\n\n\thandle {\n\t\tbasic_auth {\n\t\t\t{$GRIST_ADMIN_USER} {$GRIST_ADMIN_HASH}\n\t\t}\n\t\t# Grist reads this header at /auth/login (GRIST_FORWARD_AUTH_HEADER); the gateway always sets it.\n\t\treverse_proxy {$GRIST_UPSTREAM} {\n\t\t\theader_up X-Forwarded-User {$GRIST_ADMIN_EMAIL}\n\t\t\theader_up -Authorization\n\t\t}\n\t}\n}"
    },
    {
      "key": "GRIST_URL",
      "service": "gateway",
      "description": "Provide a value for GRIST_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "GRIST_UPSTREAM",
      "service": "gateway",
      "description": "Provide a value for GRIST_UPSTREAM.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "GRIST_ADMIN_USER",
      "service": "gateway",
      "description": "Provide a value for GRIST_ADMIN_USER.",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "GRIST_ADMIN_EMAIL",
      "service": "gateway",
      "description": "Provide a value for GRIST_ADMIN_EMAIL.",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "GRIST_ADMIN_PASSWORD",
      "service": "gateway",
      "description": "Provide a value for GRIST_ADMIN_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "grist-1"
      }
    },
    "cli": "railway deploy --template grist-1",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "f1b93fcf-0063-45ac-ae87-76579e2827b1",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0a98a30b-961a-483b-8cfe-69cf76cb44cd": {
                  "icon": "https://raw.githubusercontent.com/gristlabs/grist-core/v1.7.19/static/icons/favicon.png",
                  "name": "grist",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/status",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "gristlabs/grist:1.7.19"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "defaultValue": "8484"
                    },
                    "APP_HOME_URL": {
                      "isOptional": false,
                      "defaultValue": "https://${{gateway.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "GRIST_IN_SERVICE": {
                      "isOptional": false,
                      "defaultValue": "true"
                    },
                    "GRIST_ADMIN_EMAIL": {
                      "isOptional": false,
                      "defaultValue": "${{gateway.GRIST_ADMIN_EMAIL}}"
                    },
                    "GRIST_FORCE_LOGIN": {
                      "isOptional": false,
                      "defaultValue": "true"
                    },
                    "GRIST_DEFAULT_EMAIL": {
                      "isOptional": false,
                      "defaultValue": "${{gateway.GRIST_ADMIN_EMAIL}}"
                    },
                    "GRIST_SANDBOX_FLAVOR": {
                      "isOptional": false,
                      "defaultValue": "pyodide"
                    },
                    "GRIST_SESSION_SECRET": {
                      "isOptional": false,
                      "defaultValue": "{{GRIST_SESSION_SECRET}}"
                    },
                    "GRIST_TELEMETRY_LEVEL": {
                      "isOptional": false,
                      "defaultValue": "off"
                    },
                    "GRIST_FORWARD_AUTH_HEADER": {
                      "isOptional": false,
                      "defaultValue": "X-Forwarded-User"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "defaultValue": "20"
                    }
                  },
                  "volumeMounts": {
                    "0a98a30b-961a-483b-8cfe-69cf76cb44cd": {
                      "mountPath": "/persist"
                    }
                  }
                },
                "8c5a6752-14a6-4d33-a62c-41c7c53ee4c9": {
                  "icon": "https://raw.githubusercontent.com/caddyserver/website/5c921006aae4feb2184782ae528c2bb09a07e04f/src/resources/images/favicon.png",
                  "name": "gateway",
                  "deploy": {
                    "startCommand": "sh -c 'export GRIST_ADMIN_HASH=$(caddy hash-password --plaintext \"$GRIST_ADMIN_PASSWORD\") && printf \"%s\\n\" \"$CADDYFILE\" > /tmp/Caddyfile && exec caddy run --config /tmp/Caddyfile --adapter caddyfile'",
                    "healthcheckPath": "/gateway_health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "caddy:2.11.4-alpine"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "defaultValue": "8080"
                    },
                    "CADDYFILE": {
                      "isOptional": false,
                      "defaultValue": "{\n\tadmin off\n\tauto_https off\n}\n\n:{$PORT} {\n\thandle /gateway_health {\n\t\trespond ok 200\n\t}\n\n\t# Grist's own health endpoint stays open.\n\thandle /status {\n\t\treverse_proxy {$GRIST_UPSTREAM}\n\t}\n\n\t# Grist API keys go straight to Grist, which validates them itself.\n\t@apikey header_regexp Authorization `^Bearer .+`\n\thandle @apikey {\n\t\treverse_proxy {$GRIST_UPSTREAM} {\n\t\t\theader_up -X-Forwarded-User\n\t\t}\n\t}\n\n\thandle {\n\t\tbasic_auth {\n\t\t\t{$GRIST_ADMIN_USER} {$GRIST_ADMIN_HASH}\n\t\t}\n\t\t# Grist reads this header at /auth/login (GRIST_FORWARD_AUTH_HEADER); the gateway always sets it.\n\t\treverse_proxy {$GRIST_UPSTREAM} {\n\t\t\theader_up X-Forwarded-User {$GRIST_ADMIN_EMAIL}\n\t\t\theader_up -Authorization\n\t\t}\n\t}\n}"
                    },
                    "GRIST_URL": {
                      "isOptional": false,
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "GRIST_UPSTREAM": {
                      "isOptional": false,
                      "defaultValue": "${{grist.RAILWAY_PRIVATE_DOMAIN}}:8484"
                    },
                    "GRIST_ADMIN_USER": {
                      "isOptional": false,
                      "defaultValue": "admin"
                    },
                    "GRIST_ADMIN_EMAIL": {
                      "isOptional": false,
                      "defaultValue": "admin@example.com"
                    },
                    "GRIST_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{GRIST_ADMIN_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "gateway",
      "method": "GET",
      "path": "/gateway_health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-24T22:14:48.880Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-24T19:41:21.555Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_6a239b8987c14ed98774",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 40,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "grist"
  }
}
