From 297af0ab0ddb96e757d745934af7673929023c5c Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Tue, 24 Mar 2026 13:49:43 +0100 Subject: [PATCH] feat: add libcap to Dockerfile and ensure Remotion browser binary is downloaded --- Dockerfile | 7 ++++++- server/routes/remotion.ts | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2c58346..1aa4120 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,8 @@ RUN apk add --no-cache \ harfbuzz \ ca-certificates \ ttf-freefont \ - ffmpeg + ffmpeg \ + libcap # Copier les fichiers de configuration COPY package*.json ./ @@ -72,6 +73,10 @@ RUN rm -rf client/node_modules \ # Pré-bundler la composition Remotion pendant le build (speedup au premier rendu) RUN node scripts/prebundle-remotion.js || true +# S'assurer que le binaire browser de Remotion est téléchargé et disponible +RUN npx remotion browser ensure + + # Exposer le port de l'application EXPOSE 5555 diff --git a/server/routes/remotion.ts b/server/routes/remotion.ts index 9733772..11cc133 100644 --- a/server/routes/remotion.ts +++ b/server/routes/remotion.ts @@ -170,13 +170,21 @@ remotionRouter.post("/render", upload.array("images", 4), async (req, res) => { const outputLocation = path.join(uploadDir, outputFilename); console.log("🎬 Rendering media...", effectiveDurationInFrames, "frames"); + + // Standard Chromium path on Alpine + const systemChromiumPath = "/usr/bin/chromium-browser"; + const browserExecutable = fs.existsSync(systemChromiumPath) ? systemChromiumPath : undefined; + await renderMedia({ composition: { ...composition, durationInFrames: effectiveDurationInFrames }, serveUrl: bundleLocation, codec: "h264", outputLocation, inputProps, - chromiumOptions: { disableWebSecurity: true } + browserExecutable, + chromiumOptions: { + disableWebSecurity: true, + } }); console.log("✅ Render completed:", outputFilename);