Add browser fingerprint support and analytics metadata display
- Transfer user's browser fingerprint (user-agent, viewport, timezone, language, geolocation) to Chrome for more authentic scraping - Display review topics from Google Maps in analytics dashboard - Show business category badge in analytics header - Fix date_text null handling in analytics (handle undefined/timestamp fields) - Add review_topics and business_category to JobStatus interface Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -39,6 +39,13 @@ RUN apt-get update \
|
||||
&& apt-get install -y chromium chromium-driver \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install VNC server and noVNC (browser-based VNC viewer)
|
||||
RUN apt-get update && apt-get install -y \
|
||||
x11vnc \
|
||||
novnc \
|
||||
websockify \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
@@ -51,7 +58,7 @@ COPY modules/ ./modules/
|
||||
COPY api_server_production.py .
|
||||
COPY config.yaml .
|
||||
|
||||
# Create startup script for Xvfb + API server
|
||||
# Create startup script for Xvfb + VNC + API server
|
||||
RUN echo '#!/bin/bash\n\
|
||||
# Start Xvfb (virtual display) in background\n\
|
||||
Xvfb :99 -screen 0 1920x1080x24 -ac +extension GLX +render -noreset &\n\
|
||||
@@ -60,6 +67,15 @@ export DISPLAY=:99\n\
|
||||
# Wait for Xvfb to start\n\
|
||||
sleep 2\n\
|
||||
\n\
|
||||
# Start VNC server (no password for local dev, binds to all interfaces)\n\
|
||||
x11vnc -display :99 -forever -shared -rfbport 5900 -nopw -bg\n\
|
||||
\n\
|
||||
# Start noVNC websocket proxy (browser access at http://localhost:6080/vnc.html)\n\
|
||||
websockify --web=/usr/share/novnc/ 6080 localhost:5900 &\n\
|
||||
\n\
|
||||
echo "VNC server running on port 5900"\n\
|
||||
echo "noVNC web interface at http://localhost:6080/vnc.html"\n\
|
||||
\n\
|
||||
# Start API server\n\
|
||||
exec python api_server_production.py\n\
|
||||
' > /app/start.sh && chmod +x /app/start.sh
|
||||
@@ -71,8 +87,8 @@ RUN useradd -m -u 1000 scraper && \
|
||||
|
||||
USER scraper
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
# Expose ports: API (8000), VNC (5900), noVNC web (6080)
|
||||
EXPOSE 8000 5900 6080
|
||||
|
||||
# Environment variables for Chromium in container
|
||||
ENV DISPLAY=:99
|
||||
|
||||
Reference in New Issue
Block a user