{
  "manifest_version": "1.0.0",
  "template": {
    "id": "2eb47682-8e51-47e8-a5a7-ae12cdc916b0",
    "slug": "ferretdb-mongodb-alternative",
    "name": "FerretDB (MongoDB Alternative)",
    "description": "Open-source MongoDB alternative. FerretDB 2.x + Postgres DocumentDB.",
    "url": "https://railway.com/deploy/ferretdb-mongodb-alternative"
  },
  "services": [
    {
      "name": "ferretdb",
      "source": {
        "image": "ghcr.io/ferretdb/ferretdb:2.7.0"
      },
      "needs_volume": false,
      "tcp_ports": [
        27017
      ],
      "http": false
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/ferretdb/postgres-documentdb:17-0.107.0-ferretdb-2.7.0"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "FERRETDB_POSTGRESQL_URL",
      "service": "ferretdb",
      "description": "Connection to the DocumentDB-enabled Postgres over Railway private networking. Do not change.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Postgres data directory inside the attached volume. Do not change.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database name backing FerretDB. Keep as postgres.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "PostgreSQL superuser name used by FerretDB. Do not change after first deploy.",
      "secret": false,
      "strategy": "default",
      "default": "ferretdb"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Auto-generated PostgreSQL password. Also your MongoDB connection password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "ferretdb-mongodb-alternative"
      }
    },
    "cli": "railway deploy --template ferretdb-mongodb-alternative",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "2eb47682-8e51-47e8-a5a7-ae12cdc916b0",
            "serializedConfig": {
              "services": {
                "37d8e62c-3130-4fc1-bf0b-ff19a646f17a": {
                  "name": "ferretdb",
                  "source": {
                    "image": "ghcr.io/ferretdb/ferretdb:2.7.0"
                  },
                  "variables": {
                    "FERRETDB_POSTGRESQL_URL": {
                      "description": "Connection to the DocumentDB-enabled Postgres over Railway private networking. Do not change.",
                      "defaultValue": "postgres://${{ Postgres.POSTGRES_USER }}:${{ Postgres.POSTGRES_PASSWORD }}@${{ Postgres.RAILWAY_PRIVATE_DOMAIN }}:5432/${{ Postgres.POSTGRES_DB }}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "27017": {}
                    }
                  }
                },
                "8e8af1bb-fa77-4df1-890e-97947e0df82a": {
                  "name": "Postgres",
                  "source": {
                    "image": "ghcr.io/ferretdb/postgres-documentdb:17-0.107.0-ferretdb-2.7.0"
                  },
                  "variables": {
                    "PGDATA": {
                      "description": "Postgres data directory inside the attached volume. Do not change.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "description": "Database name backing FerretDB. Keep as postgres.",
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_USER": {
                      "description": "PostgreSQL superuser name used by FerretDB. Do not change after first deploy.",
                      "defaultValue": "ferretdb"
                    },
                    "POSTGRES_PASSWORD": {
                      "description": "Auto-generated PostgreSQL password. Also your MongoDB connection password.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "8e8af1bb-fa77-4df1-890e-97947e0df82a": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "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-08T23:42:17.657Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_ac2961c6795d4c278165",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 81,
    "typical_build_seconds": 0,
    "typical_start_seconds": 0,
    "slowest_service": "ferretdb"
  }
}
