{
  "manifest_version": "1.0.0",
  "template": {
    "id": "ebfae78d-551b-493c-8fa4-e32bb08edf51",
    "slug": "postgis-spatial-database",
    "name": "PostGIS | Open-Source Spatial Database on Railway",
    "description": "Self Host PostGIS: Spatial queries, topology, raster, routing ready",
    "url": "https://railway.com/deploy/postgis-spatial-database",
    "upstream": {
      "image": "postgis/postgis:17-3.5"
    }
  },
  "services": [
    {
      "name": "PostGIS",
      "source": {
        "image": "postgis/postgis:17-3.5"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "PostGIS",
      "description": "Data directory path",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "PostGIS",
      "description": "Default database name",
      "secret": false,
      "strategy": "default",
      "default": "postgis_db"
    },
    {
      "key": "DATABASE_URL",
      "service": "PostGIS",
      "description": "Internal connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "PostGIS",
      "description": "Database superuser name",
      "secret": false,
      "strategy": "default",
      "default": "postgis_admin"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "PostGIS",
      "description": "Database password (generated hex)",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "PostGIS",
      "description": "External connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "postgis-spatial-database"
      }
    },
    "cli": "railway deploy --template postgis-spatial-database",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "ebfae78d-551b-493c-8fa4-e32bb08edf51",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "d882d70a-ea7a-422e-867c-4cd76b8a9e68": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgres.svg",
                  "name": "PostGIS",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "postgis/postgis:17-3.5"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data directory path",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Default database name",
                      "defaultValue": "postgis_db"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Internal connection string",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:${{RAILWAY_TCP_APPLICATION_PORT}}/${{POSTGRES_DB}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database superuser name",
                      "defaultValue": "postgis_admin"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password (generated hex)",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "External connection string",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{POSTGRES_DB}}"
                    }
                  },
                  "volumeMounts": {
                    "d882d70a-ea7a-422e-867c-4cd76b8a9e68": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-21T22:14:44.200Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T14:21:00.698Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_217d23d3d15b41168141",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 94,
    "typical_build_seconds": 0,
    "typical_start_seconds": 0,
    "slowest_service": "PostGIS"
  }
}
