在 VPS 上部署 Remotion Studio
从 v4.0.46 版本开始可用
您可以将 Remotion Studio 部署到云中的长期运行服务器,并使渲染 UI 对您的团队可访问。
为此,您需要:
- 安装 Node.js 和 Chrome
- 在服务器上运行
npx remotion studio
- 确保端口 3000 可以通过互联网访问
以下示例已经使用 npx create-video@latest
初始化了 Hello World 模板。
将 Remotion Studio Docker 化
Dockerfiledocker
FROM node:20-bookworm# Install Chrome dependenciesRUN apt-get updateRUN apt install -y \libnss3 \libdbus-1-3 \libatk1.0-0 \libgbm-dev \libasound2 \libxrandr2 \libxkbcommon-dev \libxfixes3 \libxcomposite1 \libxdamage1 \libatk-bridge2.0-0 \libcups2# Copy everything from your project to the Docker image. Adjust if needed.COPY package.json package*.json yarn.lock* pnpm-lock.yaml* bun.lockb* tsconfig.json* remotion.config.* ./COPY src ./src# If you have a public folder:COPY public ./public# Install the right package manager and dependencies - see below for Yarn/PNPMRUN npm i# Install ChromeRUN npx remotion browser ensureCMD ["npx", "remotion studio"]
Dockerfiledocker
FROM node:20-bookworm# Install Chrome dependenciesRUN apt-get updateRUN apt install -y \libnss3 \libdbus-1-3 \libatk1.0-0 \libgbm-dev \libasound2 \libxrandr2 \libxkbcommon-dev \libxfixes3 \libxcomposite1 \libxdamage1 \libatk-bridge2.0-0 \libcups2# Copy everything from your project to the Docker image. Adjust if needed.COPY package.json package*.json yarn.lock* pnpm-lock.yaml* bun.lockb* tsconfig.json* remotion.config.* ./COPY src ./src# If you have a public folder:COPY public ./public# Install the right package manager and dependencies - see below for Yarn/PNPMRUN npm i# Install ChromeRUN npx remotion browser ensureCMD ["npx", "remotion studio"]
Fly.io
要将 Remotion Studio 部署到 Fly.io:
- 首先将上述
Dockerfile
添加到存储库中。 - 对
Dockerfile
进行以下更改(从 v4.0.125 版本开始有效):
diff
- CMD ["npx", "remotion studio"]+ CMD ["npx", "remotion studio", "--ipv4"]
diff
- CMD ["npx", "remotion studio"]+ CMD ["npx", "remotion studio", "--ipv4"]
- 确保您使用的是付费计划(免费计划内存太少)
- 使用以下命令:
bash
fly launch \# Get 2 CPU cores and 4GB of memory--vm-size=performance-2x \# Disable 2x replication--ha=false \# Use Remotion's port--internal-port=3000 \# Use Docker, not Node--dockerfile Dockerfile
bash
fly launch \# Get 2 CPU cores and 4GB of memory--vm-size=performance-2x \# Disable 2x replication--ha=false \# Use Remotion's port--internal-port=3000 \# Use Docker, not Node--dockerfile Dockerfile
对于以下问题,回答否:
txt
? Would you like to set up a Postgresql database now? No? Would you like to set up an Upstash Redis database now? No? Create .dockerignore from 1 .gitignore files? No
txt
? Would you like to set up a Postgresql database now? No? Would you like to set up an Upstash Redis database now? No? Create .dockerignore from 1 .gitignore files? No
在询问是否要部署时回答是:
? Do you want to deploy now? Yes
? Do you want to deploy now? Yes
您应该会得到部署 Studio 的 URL!
Render.com
要将 Remotion Studio 部署到 Render.com:
- 首先将上述
Dockerfile
添加到存储库中。 - 创建一个新的 "Web Service" 并链接您的存储库。
- 至少选择 "Standard" 计划(2GB 内存)。
- 部署!
DigitalOcean App Platform
目前无法正常工作。由于 DigitalOcean HTTP 代理不支持服务器发送事件,因此渲染按钮已禁用 不支持 SSE 服务器发送事件。
一般的 DigitalOcean droplet 可以正常工作。
Scaleway 无服务器容器
要部署 Scaleway 无服务器容器:
- 首先将上述
Dockerfile
添加到存储库中 - 构建您的 Docker 镜像并将其发布到 Docker 注册表(例如 Scaleway Docker Registry)
- 然后 创建您的无服务器容器命名空间 并使用 您发布的 Docker 镜像。
您可以在 此处找到一个部署 Remotion Studio 到 Scaleway 无服务器容器的 GitHub Action 工作流示例。
部署示例
一个用于部署 Remotion Studio 的测试项目可在 此处 找到。