{
  "manifest_version": "1.0.0",
  "template": {
    "id": "ebad14a5-06b4-4af8-9358-bb05acf3425f",
    "slug": "postcodesio",
    "name": "Postcodes.io",
    "description": "Self hosted postcodes.io using the official Docker containers",
    "url": "https://railway.com/deploy/postcodesio",
    "upstream": {
      "image": "idealpostcodes/postcodes.io:latest"
    }
  },
  "services": [
    {
      "name": "postcodes-db",
      "source": {
        "image": "idealpostcodes/postcodes.io.db:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "postcodes-api",
      "source": {
        "image": "idealpostcodes/postcodes.io:latest"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "postcodes-db",
      "description": "Postgres data directory. Points to a subdirectory of the mounted volume so initdb can run cleanly (Railway volumes contain a lost+found directory at the mount root). Do not change.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "postcodes-db",
      "description": "Name of the database the ONS postcode dataset is loaded into. The api connects to this database",
      "secret": false,
      "strategy": "default",
      "default": "postcodesiodb"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postcodes-db",
      "description": "Postgres role that owns the database. The api authenticates as this user.",
      "secret": false,
      "strategy": "default",
      "default": "postcodesio"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postcodes-db",
      "description": "Auto-generated password for the Postgres role. Do not edit after the database has been initialized — it would break authentication and require wiping the volume",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "postcodes-api",
      "description": "HTTP port the postcodes.io api listens on. Must match the target port on the public domain.",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "POSTGRES_HOST",
      "service": "postcodes-api",
      "description": "Private hostname of the postcodes-db service. Resolved automatically via Railway's private networking — do not edit.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_PORT",
      "service": "postcodes-api",
      "description": "Port the postcodes-db service listens on. Postgres default (5432).",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postcodes-api",
      "description": "Postgres user the api authenticates as. Mirrors POSTGRES_USER on postcodes-db.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DATABASE",
      "service": "postcodes-api",
      "description": "Name of the postcodes database. Mirrors POSTGRES_DB on postcodes-db (note: postcodes.io reads POSTGRES_DATABASE, the postgres image exposes POSTGRES_DB — the names intentionally differ).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postcodes-api",
      "description": "Password used to authenticate with postcodes-db. Mirrors POSTGRES_PASSWORD on the db service.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "postcodesio"
      }
    },
    "cli": "railway deploy --template postcodesio",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "ebad14a5-06b4-4af8-9358-bb05acf3425f",
            "serializedConfig": {
              "services": {
                "3385088b-321d-4ed0-8f39-d920c4f50c8c": {
                  "icon": "https://postcodes.io/img/house.png",
                  "name": "postcodes-db",
                  "source": {
                    "image": "idealpostcodes/postcodes.io.db:latest"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Postgres data directory. Points to a subdirectory of the mounted volume so initdb can run cleanly (Railway volumes contain a lost+found directory at the mount root). Do not change.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Name of the database the ONS postcode dataset is loaded into. The api connects to this database",
                      "defaultValue": "postcodesiodb"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Postgres role that owns the database. The api authenticates as this user.",
                      "defaultValue": "postcodesio"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated password for the Postgres role. Do not edit after the database has been initialized — it would break authentication and require wiping the volume",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "3385088b-321d-4ed0-8f39-d920c4f50c8c": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "a5db052a-9eb3-4300-8b3a-0ffbea180f1c": {
                  "icon": "https://postcodes.io/img/house.png",
                  "name": "postcodes-api",
                  "deploy": {
                    "healthcheckPath": "/ping"
                  },
                  "source": {
                    "image": "idealpostcodes/postcodes.io:latest"
                  },
                  "variables": {
                    "PORT": {
                      "description": "HTTP port the postcodes.io api listens on. Must match the target port on the public domain.",
                      "defaultValue": "8000"
                    },
                    "POSTGRES_HOST": {
                      "isOptional": false,
                      "description": "Private hostname of the postcodes-db service. Resolved automatically via Railway's private networking — do not edit.",
                      "defaultValue": "${{postcodes-db.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "POSTGRES_PORT": {
                      "isOptional": false,
                      "description": "Port the postcodes-db service listens on. Postgres default (5432).",
                      "defaultValue": "5432"
                    },
                    "POSTGRES_USER": {
                      "description": "Postgres user the api authenticates as. Mirrors POSTGRES_USER on postcodes-db.",
                      "defaultValue": "${{postcodes-db.POSTGRES_USER}}"
                    },
                    "POSTGRES_DATABASE": {
                      "description": "Name of the postcodes database. Mirrors POSTGRES_DB on postcodes-db (note: postcodes.io reads POSTGRES_DATABASE, the postgres image exposes POSTGRES_DB — the names intentionally differ).",
                      "defaultValue": "${{postcodes-db.POSTGRES_DB}}"
                    },
                    "POSTGRES_PASSWORD": {
                      "description": "Password used to authenticate with postcodes-db. Mirrors POSTGRES_PASSWORD on the db service.",
                      "defaultValue": "${{postcodes-db.POSTGRES_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8000": {
                        "port": 8000
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "postcodes-api",
      "method": "GET",
      "path": "/ping",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T11:44:05.699Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_39830354422242daa8e7",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 77,
    "typical_build_seconds": 0,
    "typical_start_seconds": 20,
    "slowest_service": "postcodes-api"
  }
}
