From a638cfba6a029349ee16c9419efd63e2209f38eb Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Wed, 25 Mar 2026 11:07:07 +0100 Subject: [PATCH] fix: use localhost for Remotion image URLs instead of Docker service hostname Remotion's headless Chromium runs inside the same container as the app, so it must use http://localhost:PORT to fetch local media files. The Docker service hostname (socialflow-app) is only reachable from other containers on the Docker network, not from within the container itself. Co-Authored-By: Claude Sonnet 4.6 --- server/routes/remotion.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/routes/remotion.ts b/server/routes/remotion.ts index a32cc06..d0aa6e2 100644 --- a/server/routes/remotion.ts +++ b/server/routes/remotion.ts @@ -93,8 +93,9 @@ remotionRouter.post("/render", upload.fields([{ name: "images", maxCount: 4 }, { const files = fields["images"] ?? []; let imageUrls: string[] = []; - const host = process.env.INTERNAL_APP_URL - || (req.protocol + "://" + req.get("host")); + // Remotion's Chromium runs inside the same container — must use localhost, not the Docker service hostname + const port = process.env.PORT || "5555"; + const host = `http://localhost:${port}`; const existing = req.body.existingImageUrls; if (existing) {