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 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Sonnet 4.6 committed 2026-03-25 11:07:07 +01:00
1 parent abaee384bf
commit a638cfba6a
1 file changed
+3 -2
+3 -2
View File
@@ -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) {