Skip to content

Instantly share code, notes, and snippets.

@WolfangAukang
Last active June 16, 2022 22:15
Show Gist options
  • Save WolfangAukang/75faab913eede7e9db3f3ce0039fe4d0 to your computer and use it in GitHub Desktop.
Save WolfangAukang/75faab913eede7e9db3f3ce0039fe4d0 to your computer and use it in GitHub Desktop.
Selenium Grid on Docker Compose
version: "3.6"
services:
hub:
image: selenium/hub:4.2.2
environment:
GRID_MAX_SESSION: 16
GRID_BROWSER_TIMEOUT: 3000
GRID_TIMEOUT: 3000
networks:
- grid
ports:
- "4442-4444:4442-4444"
chrome:
image: selenium/node-chrome:4.2.2
depends_on:
- hub
environment:
SE_EVENT_BUS_HOST: hub
SE_EVENT_BUS_PUBLISH_PORT: 4442
SE_EVENT_BUS_SUBSCRIBE_PORT: 4443
SE_NODE_MAX_SESSIONS: 3
networks:
- grid
ports:
- "9001:5900"
volumes:
- /dev/shm:/dev/shm
firefox:
image: selenium/node-firefox:4.2.2
depends_on:
- hub
environment:
SE_EVENT_BUS_HOST: hub
SE_EVENT_BUS_PUBLISH_PORT: 4442
SE_EVENT_BUS_SUBSCRIBE_PORT: 4443
SE_NODE_MAX_SESSIONS: 3
networks:
- grid
ports:
- "9002:5900"
volumes:
- /dev/shm:/dev/shm
networks:
grid:
driver: bridge
version: "3.6"
services:
hub:
image: selenium/hub
environment:
GRID_MAX_SESSION: 16
GRID_BROWSER_TIMEOUT: 3000
GRID_TIMEOUT: 3000
networks:
- grid
ports:
- "4444:4444"
chrome:
image: selenium/node-chrome-debug
depends_on:
- hub
environment:
HUB_PORT_4444_TCP_ADDR: hub
HUB_PORT_4444_TCP_PORT: 4444
NODE_MAX_SESSION: 3
NODE_MAX_INSTANCES: 3
networks:
- grid
ports:
- "9001:5900"
volumes:
- /dev/shm:/dev/shm
firefox:
image: selenium/node-firefox-debug
depends_on:
- hub
environment:
HUB_PORT_4444_TCP_ADDR: hub
HUB_PORT_4444_TCP_PORT: 4444
NODE_MAX_SESSION: 3
NODE_MAX_INSTANCES: 3
networks:
- grid
ports:
- "9002:5900"
volumes:
- /dev/shm:/dev/shm
# opera:
# image: selenium/node-opera-debug
# depends_on:
# - hub
# environment:
# HUB_PORT_4444_TCP_ADDR: hub
# HUB_PORT_4444_TCP_PORT: 4444
# NODE_MAX_SESSION: 2
# NODE_MAX_INSTANCES: 2
# networks:
# - grid
# ports:
# - "9003:5900"
# volumes:
# - /dev/shm:/dev/shm
networks:
grid:
driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment