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:Docker Compose (Recommended)
Use docker-compose for the complete setup with Selenium Grid:- Social Analyzer web application
- Selenium Hub (port 4444)
- Firefox node for browser automation
Docker Compose Configuration
Thedocker-compose.yml file defines a multi-container setup:
Architecture Overview
The Docker Compose setup consists of three services:- Selenium Hub
- Firefox Node
Starting the Services
Start in foreground
Ctrl+C.
Start in background
Build and start
Managing Containers
View running containers
View logs
Stop services
Stop and remove
Restart 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:- Available browser nodes
- Active sessions
- Browser versions
- Node status
VNC Access to Browser
Connect to the Firefox container via VNC for debugging:secret
Watch the browser in real-time as Social Analyzer performs checks.
Scaling Browser Nodes
Add more Firefox nodes
Add Chrome nodes
Modifydocker-compose.yml to include Chrome:
Using the Dockerized Application
Once running, access the web interface:Web Interface
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: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:Hub connection failed
Verify hub is running:Firefox node not connecting
Check Firefox logs:Out of memory errors
Increase Docker memory allocation in Docker Desktop settings or for Docker daemon:Slow performance
- Reduce
GRID_MAX_SESSIONto lower concurrent load - Increase
CPU_CORESif your system has capacity - Scale down Firefox nodes if over-subscribed
- Check host system resources (CPU, memory, disk I/O)
Production Deployment
Recommended Security
- Reverse Proxy: Use nginx or Apache with authentication
- VPN: Restrict access via VPN
- Firewall: Only allow specific IP addresses
- HTTPS: Use TLS/SSL certificates
- Secrets: Use Docker secrets for API keys