Skip to main content
Docker deployment provides an isolated, reproducible environment for running Social Analyzer. The docker-compose setup includes Selenium Grid integration for advanced detection modes and parallel processing.

Prerequisites

1

Install Docker

Install Docker Engine on your system:
2

Install Docker Compose

Install Docker Compose:
3

Clone repository

Quick Start

Simple Docker Run

Run Social Analyzer as a single container:
Access the web interface at:
Use docker-compose for the complete setup with Selenium Grid:
This starts:
  • Social Analyzer web application
  • Selenium Hub (port 4444)
  • Firefox node for browser automation

Docker Compose Configuration

The docker-compose.yml file defines a multi-container setup:

Architecture Overview

The Docker Compose setup consists of three services:
Main application container
  • Runs the Node.js web server
  • Serves the web interface on port 9005
  • Connects to Selenium Hub for browser automation
  • Handles detection and analysis logic

Starting the Services

Start in foreground

Watch logs in real-time and stop with Ctrl+C.

Start in background

Runs containers in detached mode.

Build and start

Rebuilds images before starting (use after code changes).

Managing Containers

View running containers

Shows status of all services:

View logs

Stop services

Stops containers without removing them.

Stop and remove

Stops and removes all containers, networks, and volumes.

Restart services

Restarts all services.

Configuration Options

Environment Variables

Customize behavior with environment variables:

Available Variables

Custom docker-compose.yml

Create a custom configuration:

Selenium Grid Integration

Grid URL

The application automatically uses the grid when started with docker-compose:

Benefits of Grid Mode

  • Parallel Processing: Multiple browser instances run simultaneously
  • Better Performance: Faster execution for advanced detection modes
  • Isolation: Browser processes isolated from main application
  • Scalability: Add more browser nodes as needed

Accessing Grid Console

View the Selenium Grid status page:
Shows:
  • Available browser nodes
  • Active sessions
  • Browser versions
  • Node status

VNC Access to Browser

Connect to the Firefox container via VNC for debugging:
Default VNC password: secret Watch the browser in real-time as Social Analyzer performs checks.

Scaling Browser Nodes

Add more Firefox nodes

Starts 5 Firefox nodes for increased parallelism.

Add Chrome nodes

Modify docker-compose.yml to include Chrome:
Then start:

Using the Dockerized Application

Once running, access the web interface:

Web Interface

Use normally - the grid option is automatically enabled.

CLI in Container

Execute CLI commands inside the container:

Python CLI in Container

If you’ve built a container with Python support:

Data Persistence

Volume Mounting

Mount a local directory to persist logs:
Then:

Export Results

Copy results from container:

Performance Optimization

Increase Shared Memory

Browser containers need adequate shared memory:

Resource Limits

Set CPU and memory limits:

Network Optimization

Use a custom network for better isolation:

Troubleshooting

Containers won’t start

Check if ports are already in use:
Kill conflicting processes or change ports.

Hub connection failed

Verify hub is running:
Test hub endpoint:

Firefox node not connecting

Check Firefox logs:
Restart the Firefox service:

Out of memory errors

Increase Docker memory allocation in Docker Desktop settings or for Docker daemon:

Slow performance

  • Reduce GRID_MAX_SESSION to lower concurrent load
  • Increase CPU_CORES if your system has capacity
  • Scale down Firefox nodes if over-subscribed
  • Check host system resources (CPU, memory, disk I/O)

Production Deployment

Do not expose Social Analyzer to the public internet without proper security measures. It lacks built-in authentication and access control.
  1. Reverse Proxy: Use nginx or Apache with authentication
  2. VPN: Restrict access via VPN
  3. Firewall: Only allow specific IP addresses
  4. HTTPS: Use TLS/SSL certificates
  5. Secrets: Use Docker secrets for API keys

Example nginx Configuration

Maintenance

Update Images

Clean Up

Health Checks

Add health checks to services: