部署概览
🌐 Deployment Overview
Mastra 应用可以部署到任何与 Node.js 兼容的环境。你可以部署 Mastra 服务器、与现有的 Web 框架集成、部署到云服务提供商,或使用 Mastra Cloud 进行托管管理。
🌐 Mastra applications can be deployed to any Node.js-compatible environment. You can deploy a Mastra server, integrate with an existing web framework, deploy to cloud providers, or use Mastra Cloud for managed hosting.
运行时支持Direct link to 运行时支持
🌐 Runtime support
Mastra 可以在以下任何运行时环境下运行:
🌐 Mastra can run against any of these runtime environments:
- Node.js
v22.13.0或更高版本 - 小圆面包
- Deno
- Cloudflare
部署选项Direct link to 部署选项
🌐 Deployment Options
Mastra 服务器Direct link to Mastra 服务器
🌐 Mastra Server
Mastra 提供了一个由 Hono 提供支持的服务器,可以独立部署。使用 mastra build 命令构建你的应用,并将输出部署到你首选的虚拟机、容器或 PaaS 平台上。
🌐 Mastra provides a server powered by Hono that can be deployed independently. Use the mastra build command to build your application and deploy the output to your preferred VM, container, or PaaS platform.
当你需要对基础设施、长时间运行的进程或 WebSocket 连接进行完全控制时,请使用此选项。Mastra 服务器部署指南 提供了更多详细信息。
🌐 Use this option when you need full control over your infrastructure, long-running processes, or WebSocket connections. The Mastra server deployment guide provides more details.
单仓库Direct link to 单仓库
🌐 Monorepo
将 Mastra 服务器作为 monorepo 设置的一部分进行部署,遵循与独立部署相同的方法。
🌐 Deploy a Mastra server as part of a monorepo setup, following the same approach as standalone deployment.
阅读有关monorepo 部署的信息。
🌐 Read about monorepo deployment.
云服务提供商Direct link to 云服务提供商
🌐 Cloud Providers
Mastra 应用可以部署到云提供商和无服务器平台。Mastra 包含可选的内置部署工具,用于 Vercel、Netlify 和 Cloudflare,以自动化构建和部署流程。
🌐 Mastra applications can be deployed to cloud providers and serverless platforms. Mastra includes optional built-in deployers for Vercel, Netlify, and Cloudflare to automate the build and deployment process.
当需要自动扩展、最小化基础设施管理,或你已经在使用这些平台之一时,请使用此选项。
🌐 Use this option for auto-scaling, minimal infrastructure management, or when you're already using one of these platforms.
网页框架Direct link to 网页框架
🌐 Web Framework
当 Mastra 与网络框架集成时,它会使用框架的标准部署流程与你的应用一起部署。下面的指南涵盖了部署所需的框架特定配置要求。
🌐 When Mastra is integrated with a web framework, it deploys alongside your application using the framework's standard deployment process. The guides below cover framework-specific configuration requirements for deployment.
在将 Mastra 添加到现有的 Next.js 或 Astro 应用时,请使用这些指南。
🌐 Use these guides when adding Mastra to an existing Next.js or Astro application.
Mastra 云Direct link to Mastra 云
🌐 Mastra Cloud
我们正在打造 Mastra Cloud,作为部署和监控 Mastra 代理的最简便平台。目前该平台处于测试阶段。
🌐 We're building Mastra Cloud to be the easiest place to deploy and observe your Mastra agents. It's currently in beta.
在 Mastra Cloud 文档 中了解更多信息。
🌐 Learn more in the Mastra Cloud docs.
工作流运行器Direct link to 工作流运行器
🌐 Workflow Runners
Mastra 工作流默认使用内置执行引擎运行。对于需要托管基础设施的生产工作负载,工作流也可以部署到像 Inngest 这样提供步骤内存化、自动重试和实时监控的专业平台上。
🌐 Mastra workflows run using the built-in execution engine by default. For production workloads requiring managed infrastructure, workflows can also be deployed to specialized platforms like Inngest that provide step memoization, automatic retries, and real-time monitoring.
请参考工作流运行指南了解执行选项,以及Inngest 部署指南了解设置说明。
🌐 Visit the Workflow Runners guide for execution options and the Inngest deployment guide for setup instructions.