Capítulo 161 de 988

Chapter 161: Dockerizing a Remotion app

Core Idea

We recommend the following structure for your Dockerfile. Read below about the individual steps and whether you need to adjust them.

Key Concepts

  • Line-by-line
  • Example render script
  • Building the Docker image
  • Giving access to the CPUs
  • Emojis
  • Japanese, Chinese, Korean, etc.
  • Why are the packages not pinned?
  • Notes for older versions

Code Examples

FROM node:22-bookworm-slim

# Install Chrome dependencies
RUN apt-get update
RUN apt install -y \
  libnss3 \
  libdbus-1-3 \
  libatk1.0-0 \
  libgbm-dev \
  libasound2 \
  libxrandr2 \
  libxkbcommon-dev \
  libxfixes3 \
  libxcomposite1 \
  libxdamage1 \
  libatk-bridge2.0-0 \
  libpango-1.0-0 \
  libcairo2 \
  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* bun.lock* 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/PNPM
RUN npm i

# Install Chrome
RUN npx remotion browser ensure

# Run your application
COPY render.mjs render.mjs
CMD ["node", "render.mjs"]
  • What it demonstrates: Usage pattern for Dockerizing a Remotion app from the official docs.

Key Takeaways

  1. Understand line-by-line when working with Dockerizing a Remotion app.
  2. Understand example render script when working with Dockerizing a Remotion app.
  3. Understand building the docker image when working with Dockerizing a Remotion app.
  4. Understand giving access to the cpus when working with Dockerizing a Remotion app.
  5. Understand emojis when working with Dockerizing a Remotion app.

Connects To

  • Azure Container Apps: related page in the Deployment & Runtimes section.
  • bun: related page in the Deployment & Runtimes section.
  • Cloudflare Containers: related page in the Deployment & Runtimes section.