Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(docker): Harden Docker security by creating non-root user and fixing permissions

LearningCircuit78e319693bd9
diff --git a/Dockerfile b/Dockerfile
index 8ea757676e..680a9f678b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,6 +12,7 @@ RUN apt-get update && apt-get upgrade -y \
build-essential \
pkg-config \
curl \
+ # Note: NodeSource install script from trusted source (https://github.com/nodesource/distributions)
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
@@ -78,6 +79,7 @@ RUN apt-get update && apt-get upgrade -y \
libxkbcommon0 \
libxrandr2 \
xdg-utils \
+ # Note: NodeSource install script from trusted source (https://github.com/nodesource/distributions)
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
@@ -88,8 +90,14 @@ ENV DOCKER_ENV=true
# Don't skip Chrome download - let Puppeteer download its own Chrome as fallback
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
+# Create non-root user for running tests
+RUN groupadd -r ldruser && useradd -r -g ldruser -u 1000 ldruser
+
# Create puppeteer cache directory with proper permissions
-RUN mkdir -p /app/puppeteer-cache && chmod -R 777 /app/puppeteer-cache
+# Use user ownership instead of 777 for security
+RUN mkdir -p /app/puppeteer-cache && \
+ chown -R ldruser:ldruser /app/puppeteer-cache && \
+ chmod -R 755 /app/puppeteer-cache
# Install Playwright with Chromium first (before npm packages)
RUN playwright install --with-deps chromium || echo "Playwright install failed, will use Puppeteer's Chrome"
@@ -168,7 +176,8 @@ RUN python -c "from local_deep_research.database.sqlcipher_compat import get_sql
RUN playwright install
# Create volume for persistent configuration
-VOLUME /root/.config/local_deep_research
+# Use /app for configuration to support non-root users in test container
+VOLUME /app/.config/local_deep_research
# Create volume for Ollama start script
VOLUME /scripts/