Fix: missing playwright in non-root (closes #18)

This commit is contained in:
Phiality authored and GitHub committed 2025-11-25 17:17:53 +11:00
1 parent 336a5c2d0d
commit 77c3534ceb
1 file changed
+7 -4
+7 -4
View File
@@ -36,12 +36,12 @@ COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Install Playwright browsers (Chromium)
RUN playwright install chromium
RUN playwright install-deps chromium
# Install Playwright system dependencies for all browsers (requires root)
RUN playwright install-deps
# Create a non-root user to run the application
RUN groupadd -r librecrawl && useradd -r -g librecrawl -u 1000 librecrawl
RUN groupadd -r librecrawl && useradd -r -g librecrawl -u 1000 librecrawl \
&& mkdir -p /home/librecrawl && chown -R librecrawl:librecrawl /home/librecrawl
# Copy application code
COPY --chown=librecrawl:librecrawl . .
@@ -55,6 +55,9 @@ RUN chown -R librecrawl:librecrawl /app
# Switch to non-root user
USER librecrawl
# Install all Playwright browsers as non-root user (installs to /home/librecrawl/.cache/ms-playwright)
RUN playwright install
# Expose Flask port
EXPOSE 5000