version: "3" 
services:
  social-analyzer:
    build: .
    ports:
      - "9005:9005"
    depends_on:
      - hub
    links:
      - hub
    entrypoint: npm start -- --docker --grid "http://hub:4444/wd/hub"
  hub:
    image: selenium/hub
    ports:
      - "4444:4444"
    environment:
      GRID_MAX_SESSION: 16
      GRID_BROWSER_TIMEOUT: 6000
      GRID_TIMEOUT: 6000
  firefox:
    image: selenium/node-firefox
    container_name: web-automation_firefox
    depends_on:
      - hub
    environment:
      HUB_PORT_4444_TCP_ADDR: hub
      HUB_PORT_4444_TCP_PORT: 4444
      NODE_MAX_SESSION: 2
      NODE_MAX_INSTANCES: 10
    volumes:
      - /dev/shm:/dev/shm
    ports:
      - "9002:5900"
    links:
      - hub
