Skip to content

Instantly share code, notes, and snippets.

@bjongbloedt
Last active September 16, 2024 09:51
Show Gist options
  • Save bjongbloedt/14c18a74f150c6474671b9a8a9899921 to your computer and use it in GitHub Desktop.
Save bjongbloedt/14c18a74f150c6474671b9a8a9899921 to your computer and use it in GitHub Desktop.
docker-compose selenium grid (w/healthcheck)
version: "3"
services:
hub:
image: selenium/hub
ports:
- "4444:4444"
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:4444/grid/api/proxy"]
interval: 10s
timeout: 5s
retries: 3
firefox:
image: selenium/node-firefox
depends_on:
- hub
environment:
HUB_PORT_4444_TCP_ADDR: hub
HUB_PORT_4444_TCP_PORT: 4444
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:5555"]
interval: 10s
timeout: 5s
retries: 3
chrome:
image: selenium/node-chrome
depends_on:
- hub
environment:
HUB_PORT_4444_TCP_ADDR: hub
HUB_PORT_4444_TCP_PORT: 4444
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:5555"]
interval: 10s
timeout: 5s
retries: 3
@toto6038
Copy link

Possibly better to pipe the JSON from Selenium endpoints to jq to filter actual health indication such as ready for Selenium Hub or availability for Selenium Node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment