{
  "manifest_version": "1.0.0",
  "template": {
    "id": "55d512c7-b5b9-4979-85c4-489fb44da394",
    "slug": "pgduckdb",
    "name": "pg_duckdb",
    "description": "DuckDB powered Postgres for analytics",
    "url": "https://railway.com/deploy/pgduckdb",
    "upstream": {
      "image": "pgduckdb/pgduckdb:18-main"
    }
  },
  "services": [
    {
      "name": "pg_duckdb",
      "source": {
        "image": "pgduckdb/pgduckdb:18-main"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "pg_duckdb",
      "description": "Cluster data directory inside container; must match volume mount path",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "pg_duckdb",
      "description": "Default host — internal domain for service-to-service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "pg_duckdb",
      "description": "Default port — Postgres standard",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "pg_duckdb",
      "description": "Default username for libpq tools",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "pg_duckdb",
      "description": "Default DB name for psql/pg_dump",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "pg_duckdb",
      "description": "Default password for libpq tools",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "pg_duckdb",
      "description": "Initial database created on first boot only; ignored after init",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "pg_duckdb",
      "description": "Internal connection string — use from other Railway services, faster than public URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "pg_duckdb",
      "description": "Superuser name set on first boot; cannot start with \"pg_\"",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "pg_duckdb",
      "description": "Validity (days) of self-signed SSL cert generated on first boot",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "pg_duckdb",
      "description": "Run as root so postgres entrypoint can gosu-drop to postgres user; don't change",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "pg_duckdb",
      "description": "Superuser password set on first boot; rotate since previous value leaked",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "pg_duckdb",
      "description": "External connection string — use from laptop, CI, services outside Railway",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "pg_duckdb",
      "description": "Grace period for in-flight queries before old container is killed on redeploy",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "pgduckdb"
      }
    },
    "cli": "railway deploy --template pgduckdb",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "55d512c7-b5b9-4979-85c4-489fb44da394",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "c9a72f25-283c-434e-8e23-449527c180ac": {
                  "icon": "https://t0.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://duckdb.org/trademark_guidelines&size=256",
                  "name": "pg_duckdb",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "pgduckdb/pgduckdb:18-main"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Cluster data directory inside container; must match volume mount path",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Default host — internal domain for service-to-service",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Default port — Postgres standard",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Default username for libpq tools",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Default DB name for psql/pg_dump",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Default password for libpq tools",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Initial database created on first boot only; ignored after init",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Internal connection string — use from other Railway services, faster than public URL",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{POSTGRES_DB}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser name set on first boot; cannot start with \"pg_\"",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Validity (days) of self-signed SSL cert generated on first boot",
                      "defaultValue": "820"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Run as root so postgres entrypoint can gosu-drop to postgres user; don't change",
                      "defaultValue": "0"
                    },
                    "MOTHERDUCK_TOKEN": {
                      "isOptional": true,
                      "description": "MotherDuck access token; when non-empty, auto-enables duckdb.motherduck_enabled=true. Leave unset/empty to skip MotherDuck.",
                      "defaultValue": ""
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password set on first boot; rotate since previous value leaked",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "External connection string — use from laptop, CI, services outside Railway",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{POSTGRES_DB}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Grace period for in-flight queries before old container is killed on redeploy",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "c9a72f25-283c-434e-8e23-449527c180ac": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-22T04:14:41.730Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T12:32:01.547Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_a92410246ebd4f8192dc",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 65,
    "typical_build_seconds": 0,
    "typical_start_seconds": 0,
    "slowest_service": "pg_duckdb"
  }
}
