Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

fix: resolved Langflow data directory permission error on macOS with Podman

Mike Pawlowski69460cc5e517
diff --git a/Dockerfile.langflow b/Dockerfile.langflow
index 122c8e5ea..d727620d4 100644
--- a/Dockerfile.langflow
+++ b/Dockerfile.langflow
@@ -6,6 +6,13 @@ FROM langflowai/langflow:1.8.0
RUN pip install uv \
&& mkdir -p /app/langflow-data
+# Copy the entrypoint before switching to root so the COPY runs as uid=1000
+# (which owns /app), then switch to root so the entrypoint can correct
+# bind-mount permissions at runtime before dropping back to uid=1000.
+COPY --chmod=755 scripts/langflow-entrypoint.py /usr/local/bin/langflow-entrypoint
+USER root
+
EXPOSE 7860
+ENTRYPOINT ["langflow-entrypoint"]
CMD ["langflow", "run", "--host", "0.0.0.0", "--port", "7860"]
diff --git a/scripts/langflow-entrypoint.py b/scripts/langflow-entrypoint.py
new file mode 100644
index 000000000..ed596f758
--- /dev/null
+++ b/scripts/langflow-entrypoint.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+"""Entrypoint for the OpenRAG Langflow container.
+
+Runs as root to correct /app/langflow-data bind-mount permissions, then drops
+to uid/gid 1000 (langflow user) before exec-ing the main process.
+
+On macOS with Podman the virtiofs layer does not faithfully propagate
+host-side chmod into the container, so permissions must be fixed from
+inside the container after the mount is established.
+"""
+import os
+import pathlib
+import sys
+
+data_dir = pathlib.Path("/app/langflow-data")
+
+try:
+ data_dir.chmod(0o777)
+except OSError:
+ pass
+
+# Drop from root to langflow (uid=1000, gid=1000).
+os.setgid(1000)
+os.setuid(1000)
+
+os.execvp(sys.argv[1], sys.argv[1:])