{
  "manifest_version": "1.0.0",
  "template": {
    "id": "86251c1a-dcbf-47b6-bc5b-0ec7294086e8",
    "slug": "ghost-cms-mysql",
    "name": "Ghost CMS + MySQL",
    "description": "Ghost 6 with MySQL 8, volumes, private networking, and safer startup.",
    "url": "https://railway.com/deploy/ghost-cms-mysql",
    "upstream": {
      "image": "ghost:6-alpine"
    }
  },
  "services": [
    {
      "name": "mysql",
      "source": {
        "image": "mysql:8.4"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/mysql",
      "http": false
    },
    {
      "name": "ghost",
      "source": {
        "image": "ghost:6-alpine"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/ghost/content",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "MYSQL_USER",
      "service": "mysql",
      "description": "Application username Ghost uses to connect to MySQL.",
      "secret": false,
      "strategy": "default",
      "default": "ghost"
    },
    {
      "key": "MYSQL_DATABASE",
      "service": "mysql",
      "description": "Database name created for the Ghost application.",
      "secret": false,
      "strategy": "default",
      "default": "ghost"
    },
    {
      "key": "MYSQL_PASSWORD",
      "service": "mysql",
      "description": "Generated password for the Ghost MySQL application user.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "MYSQL_ROOT_PASSWORD",
      "service": "mysql",
      "description": "Generated root password for administrative MySQL access.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "url",
      "service": "ghost",
      "description": "Ghost site URL. Railway fills this from the generated public domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PORT",
      "service": "ghost",
      "description": "Railway HTTP proxy port for the Ghost service.",
      "secret": false,
      "strategy": "default",
      "default": "2368"
    },
    {
      "key": "server__host",
      "service": "ghost",
      "description": "Bind Ghost to all network interfaces inside the container.",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "server__port",
      "service": "ghost",
      "description": "Ghost application port exposed by the container.",
      "secret": false,
      "strategy": "default",
      "default": "2368"
    },
    {
      "key": "database__client",
      "service": "ghost",
      "description": "Database driver Ghost should use.",
      "secret": false,
      "strategy": "default",
      "default": "mysql"
    },
    {
      "key": "database__connection__host",
      "service": "ghost",
      "description": "Private hostname for the MySQL service on Railway.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "database__connection__port",
      "service": "ghost",
      "description": "Internal MySQL port.",
      "secret": false,
      "strategy": "default",
      "default": "3306"
    },
    {
      "key": "database__connection__user",
      "service": "ghost",
      "description": "MySQL user Ghost uses for application queries.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "database__connection__database",
      "service": "ghost",
      "description": "MySQL database Ghost stores content in.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "database__connection__password",
      "service": "ghost",
      "description": "Password for the Ghost MySQL application user.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "ghost-cms-mysql"
      }
    },
    "cli": "railway deploy --template ghost-cms-mysql",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "86251c1a-dcbf-47b6-bc5b-0ec7294086e8",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "34d1b278-1361-4735-9c29-33ac95cd227f": {
                  "icon": "https://devicons.railway.com/i/mysql.svg",
                  "name": "mysql",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "mysql:8.4"
                  },
                  "variables": {
                    "MYSQL_USER": {
                      "isOptional": false,
                      "description": "Application username Ghost uses to connect to MySQL.",
                      "defaultValue": "ghost"
                    },
                    "MYSQL_DATABASE": {
                      "isOptional": false,
                      "description": "Database name created for the Ghost application.",
                      "defaultValue": "ghost"
                    },
                    "MYSQL_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated password for the Ghost MySQL application user.",
                      "defaultValue": "{{MYSQL_PASSWORD}}"
                    },
                    "MYSQL_ROOT_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated root password for administrative MySQL access.",
                      "defaultValue": "{{MYSQL_ROOT_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "34d1b278-1361-4735-9c29-33ac95cd227f": {
                      "mountPath": "/var/lib/mysql"
                    }
                  },
                  "haTemplateCode": "mysql-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxies",
                      "options": [
                        1,
                        2
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "HAProxy instances routing writes to the primary",
                      "defaultValue": 2
                    },
                    "replica": {
                      "label": "MySQL Replicas",
                      "options": [
                        2,
                        4,
                        6,
                        8
                      ],
                      "nodeLabel": "MySQL",
                      "description": "Requires odd count for quorum",
                      "defaultValue": 2
                    },
                    "internal": null,
                    "description": "This will convert your MySQL instance to an HA cluster with Group Replication failover and HAProxy routing to the primary.",
                    "supportedImageMajorVersions": [
                      8,
                      9
                    ]
                  }
                },
                "b44904ec-4e59-4431-8034-1e2a8bffbc4a": {
                  "icon": "https://docs.ghost.org/favicon.png",
                  "name": "ghost",
                  "deploy": {
                    "startCommand": "/bin/sh -lc 'set -eu; host=\"${database__connection__host:-mysql.railway.internal}\"; port=\"${database__connection__port:-3306}\"; attempt=1; until node -e \"const net=require(process.argv[3]); const socket=net.createConnection({host:process.argv[1],port:Number(process.argv[2])},()=>process.exit(0)); socket.setTimeout(3000); socket.on(process.argv[4],()=>process.exit(1)); socket.on(process.argv[5],()=>process.exit(1));\" \"$host\" \"$port\" net error timeout; do if [ \"$attempt\" -ge 60 ]; then echo \"MySQL did not become reachable at $host:$port\"; exit 1; fi; echo \"Waiting for MySQL at $host:$port ($attempt/60)\"; attempt=$((attempt + 1)); sleep 2; done; exec docker-entrypoint.sh node current/index.js'",
                    "healthcheckPath": "",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghost:6-alpine"
                  },
                  "variables": {
                    "url": {
                      "isOptional": false,
                      "description": "Ghost site URL. Railway fills this from the generated public domain.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "Railway HTTP proxy port for the Ghost service.",
                      "defaultValue": "2368"
                    },
                    "server__host": {
                      "isOptional": false,
                      "description": "Bind Ghost to all network interfaces inside the container.",
                      "defaultValue": "0.0.0.0"
                    },
                    "server__port": {
                      "isOptional": false,
                      "description": "Ghost application port exposed by the container.",
                      "defaultValue": "2368"
                    },
                    "database__client": {
                      "isOptional": false,
                      "description": "Database driver Ghost should use.",
                      "defaultValue": "mysql"
                    },
                    "database__connection__host": {
                      "isOptional": false,
                      "description": "Private hostname for the MySQL service on Railway.",
                      "defaultValue": "${{mysql.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "database__connection__port": {
                      "isOptional": false,
                      "description": "Internal MySQL port.",
                      "defaultValue": "3306"
                    },
                    "database__connection__user": {
                      "isOptional": false,
                      "description": "MySQL user Ghost uses for application queries.",
                      "defaultValue": "${{mysql.MYSQL_USER}}"
                    },
                    "database__connection__database": {
                      "isOptional": false,
                      "description": "MySQL database Ghost stores content in.",
                      "defaultValue": "${{mysql.MYSQL_DATABASE}}"
                    },
                    "database__connection__password": {
                      "isOptional": false,
                      "description": "Password for the Ghost MySQL application user.",
                      "defaultValue": "${{mysql.MYSQL_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "b44904ec-4e59-4431-8034-1e2a8bffbc4a": {
                      "mountPath": "/var/lib/ghost/content"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-09T09:51:50.213Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_016f08856d594daf9c6f",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 61,
    "typical_build_seconds": 0,
    "typical_start_seconds": 20,
    "slowest_service": "ghost"
  }
}
