{
  "manifest_version": "1.0.0",
  "template": {
    "id": "b90cf893-f12f-4714-b5ba-32e3f7fcb024",
    "slug": "codex-pooler-1",
    "name": "Codex Pooler",
    "description": "The full featured self-hosted Codex gateway, for teams, agents and you",
    "url": "https://railway.com/deploy/codex-pooler-1",
    "upstream": {
      "image": "ghcr.io/icoretech/codex-pooler:latest"
    }
  },
  "services": [
    {
      "name": "Codex Pooler",
      "source": {
        "image": "ghcr.io/icoretech/codex-pooler:latest"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "postgres:18-alpine"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Codex Pooler",
      "description": "Application port. Keep 4000 to match the public domain and readiness check.",
      "secret": false,
      "strategy": "default",
      "default": "4000"
    },
    {
      "key": "PHX_HOST",
      "service": "Codex Pooler",
      "description": "Generated public hostname. For a custom domain, replace this with that hostname without https:// or a path.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "OBAN_MODE",
      "service": "Codex Pooler",
      "description": "Keep all: runs web requests, background jobs and scheduled tasks in this single application service.",
      "secret": false,
      "strategy": "default",
      "default": "all"
    },
    {
      "key": "POOL_SIZE",
      "service": "Codex Pooler",
      "description": "Database connections per application replica. Keep 10 for the default single-replica deployment.",
      "secret": false,
      "strategy": "default",
      "default": "10"
    },
    {
      "key": "PHX_SERVER",
      "service": "Codex Pooler",
      "description": "Keep true to start the HTTP server. The pre-deploy migration command disables it only for its own process.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "DATABASE_URL",
      "service": "Codex Pooler",
      "description": "Private connection to the included Postgres service. References resolve automatically; keep the database private.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "SECRET_KEY_BASE",
      "service": "Codex Pooler",
      "description": "Generated 64-character session secret. Preserve it across redeployments and keep a secure backup.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "CODEX_POOLER_TOTP_KEY_VERSION",
      "service": "Codex Pooler",
      "description": "Encryption key version label. Keep v1; changing the label alone does not rotate stored secrets.",
      "secret": true,
      "strategy": "default",
      "default": "v1"
    },
    {
      "key": "CODEX_POOLER_TOTP_ENCRYPTION_KEY",
      "service": "Codex Pooler",
      "description": "Generated independent 32-character key for operator two-factor secrets. Preserve and back it up with the database.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "CODEX_POOLER_UPSTREAM_SECRET_KEY",
      "service": "Codex Pooler",
      "description": "Generated independent 32-character key for stored upstream credentials. Preserve and back it up with the database.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Codex Pooler",
      "description": "Keep 135 seconds to allow the app to drain active requests and finish background-job shutdown.",
      "secret": false,
      "strategy": "default",
      "default": "135"
    },
    {
      "key": "CODEX_POOLER_UPSTREAM_SECRET_KEY_VERSION",
      "service": "Codex Pooler",
      "description": "Upstream encryption key version label. Keep v1 unless following an explicit key-rotation procedure.",
      "secret": true,
      "strategy": "default",
      "default": "v1"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database created on first startup. Keep codex_pooler; changing this later does not rename an existing database.",
      "secret": false,
      "strategy": "default",
      "default": "codex_pooler"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Database owner created on first startup. Keep codex_pooler; the application references this automatically.",
      "secret": false,
      "strategy": "default",
      "default": "codex_pooler"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated independent database password. Preserve it across redeployments; changing a variable alone does not rotate the stored database role password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "codex-pooler-1"
      }
    },
    "cli": "railway deploy --template codex-pooler-1",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "b90cf893-f12f-4714-b5ba-32e3f7fcb024",
            "serializedConfig": {
              "services": {
                "476ef54b-9954-4023-949e-a2e98ecd53dd": {
                  "name": "Codex Pooler",
                  "deploy": {
                    "healthcheckPath": "/readyz",
                    "preDeployCommand": [
                      "env -u PHX_SERVER /app/bin/codex_pooler eval \"CodexPooler.Release.migrate(); CodexPooler.Release.import_openai_pricing_from_priv()\""
                    ]
                  },
                  "source": {
                    "image": "ghcr.io/icoretech/codex-pooler:latest"
                  },
                  "variables": {
                    "PORT": {
                      "description": "Application port. Keep 4000 to match the public domain and readiness check.",
                      "defaultValue": "4000"
                    },
                    "PHX_HOST": {
                      "description": "Generated public hostname. For a custom domain, replace this with that hostname without https:// or a path.",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "OBAN_MODE": {
                      "description": "Keep all: runs web requests, background jobs and scheduled tasks in this single application service.",
                      "defaultValue": "all"
                    },
                    "POOL_SIZE": {
                      "description": "Database connections per application replica. Keep 10 for the default single-replica deployment.",
                      "defaultValue": "10"
                    },
                    "PHX_SERVER": {
                      "description": "Keep true to start the HTTP server. The pre-deploy migration command disables it only for its own process.",
                      "defaultValue": "true"
                    },
                    "DATABASE_URL": {
                      "description": "Private connection to the included Postgres service. References resolve automatically; keep the database private.",
                      "defaultValue": "postgresql://${{Postgres.POSTGRES_USER}}:${{Postgres.POSTGRES_PASSWORD}}@${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{Postgres.POSTGRES_DB}}"
                    },
                    "SECRET_KEY_BASE": {
                      "description": "Generated 64-character session secret. Preserve it across redeployments and keep a secure backup.",
                      "defaultValue": "{{SECRET_KEY_BASE}}"
                    },
                    "CODEX_POOLER_TOTP_KEY_VERSION": {
                      "description": "Encryption key version label. Keep v1; changing the label alone does not rotate stored secrets.",
                      "defaultValue": "v1"
                    },
                    "CODEX_POOLER_TOTP_ENCRYPTION_KEY": {
                      "description": "Generated independent 32-character key for operator two-factor secrets. Preserve and back it up with the database.",
                      "defaultValue": "{{CODEX_POOLER_TOTP_ENCRYPTION_KEY}}"
                    },
                    "CODEX_POOLER_UPSTREAM_SECRET_KEY": {
                      "description": "Generated independent 32-character key for stored upstream credentials. Preserve and back it up with the database.",
                      "defaultValue": "{{CODEX_POOLER_UPSTREAM_SECRET_KEY}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "description": "Keep 135 seconds to allow the app to drain active requests and finish background-job shutdown.",
                      "defaultValue": "135"
                    },
                    "CODEX_POOLER_UPSTREAM_SECRET_KEY_VERSION": {
                      "description": "Upstream encryption key version label. Keep v1 unless following an explicit key-rotation procedure.",
                      "defaultValue": "v1"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:4000": {
                        "port": 4000
                      }
                    }
                  }
                },
                "df0fb180-e330-48d9-9a1a-9c8ccd461ab6": {
                  "name": "Postgres",
                  "source": {
                    "image": "postgres:18-alpine"
                  },
                  "variables": {
                    "POSTGRES_DB": {
                      "description": "Database created on first startup. Keep codex_pooler; changing this later does not rename an existing database.",
                      "defaultValue": "codex_pooler"
                    },
                    "POSTGRES_USER": {
                      "description": "Database owner created on first startup. Keep codex_pooler; the application references this automatically.",
                      "defaultValue": "codex_pooler"
                    },
                    "POSTGRES_PASSWORD": {
                      "description": "Generated independent database password. Preserve it across redeployments; changing a variable alone does not rotate the stored database role password.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "df0fb180-e330-48d9-9a1a-9c8ccd461ab6": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Codex Pooler",
      "method": "GET",
      "path": "/readyz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-10-17T04:14:47.046Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-10-17T03:05:11.777Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_265b52ca06ec4c579a36",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "SUCCESS,FAILED"
      }
    ]
  }
}
