部署
🌐 Deployment
Page summary:部署选项包括硬件/软件先决条件、环境变量设置以及在启动前构建管理面板。在文档中:提供了针对特定提供商的指南和高级指南的链接,以帮助选择合适的托管策略。
Strapi 为你的项目或应用提供了多种部署选项。你的 Strapi 应用可以部署在传统托管服务器上,或你偏好的托管提供商上。
🌐 Strapi provides many deployment options for your project or application. Your Strapi applications can be deployed on traditional hosting servers or your preferred hosting provider.
以下文档介绍了如何使用几个常见的托管选项准备 Strapi 以进行部署的基础知识。
🌐 The following documentation covers the basics of how to prepare Strapi for deployment on with several common hosting options.
你可以使用 Strapi Cloud 快速部署和托管你的项目。
🌐 You can use Strapi Cloud to quickly deploy and host your project.
如果你已经使用内容类型构建器创建了内容结构,并通过内容管理器向本地(开发)Strapi 实例添加了一些数据,你可以利用数据管理系统将数据从一个 Strapi 实例传输到另一个实例。
🌐 If you already created a content structure with the Content-Type Builder and added some data through the Content Manager to your local (development) Strapi instance, you can leverage the data management system to transfer data from a Strapi instance to another one.
另一种可能的工作流程是首先在本地创建内容结构,将项目推送到基于 git 的存储库,将更改部署到生产环境,然后再将内容添加到生产实例。
🌐 Another possible workflow is to first create the content structure locally, push your project to a git-based repository, deploy the changes to production, and only then add content to the production instance.
对于自托管的 Kubernetes 部署,我们建议使用 npm 而不是 pnpm。pnpm 对依赖的激进提升可能会破坏本地模块,例如 mysql2——你的应用可能依赖它们。npm 更平坦、更可预测的 node_modules 布局有助于确保本地包正确加载。
🌐 For self-hosted Kubernetes deployments, we recommend using npm rather than pnpm. pnpm aggressive hoisting of dependencies can break native modules, such as mysql2— that your application may rely on. npm flatter, more predictable node_modules layout helps ensure native packages load correctly.
一般指南
🌐 General guidelines
硬件和软件要求
🌐 Hardware and software requirements
为了为 Strapi 提供尽可能最佳的环境,以下要求适用于开发(本地)以及登台和生产工作流程。
🌐 To provide the best possible environment for Strapi the following requirements apply to development (local) and staging and production workflows.