1+ # The purpose of this `docker-compose.yml` example is to run 1 hub, 1 chrome, 1 firefox
2+ # i.e. this example doesn't scale, but there is another file for that: docker-compose-scales.yml
3+ # i.e. this example doesn't support `docker-compose scale`
4+ #
5+ # If you try to scale this one you will get `Bind for 0.0.0.0:6080 failed: port is already allocated`
6+ #
17# Usage:
28# docker-compose -p grid up --force-recreate
3- # docker-compose -p grid scale mock=1 hub=1 chrome=3 firefox=3
4- version : ' 2.1'
9+ version : ' 3'
510
611services :
712 hub :
813 image : elgalu/selenium
914 ports :
10- # Note 24444 is the default SELENIUM_HUB_PORT inside the container
11- # and 4444 will be mapped into your host for easy access.
1215 - 4444:4444
13- # We need a fixed port range to expose VNC
14- # due to a bug in Docker for Mac beta (1.12)
15- # https://forums.docker.com/t/docker-for-mac-beta-not-forwarding-ports/8658/6
16- - ${VNC_FROM_PORT-40650}-${VNC_TO_PORT-40700}:${VNC_FROM_PORT-40650}-${VNC_TO_PORT-40700}
17- # e.g. (hard-coded)
18- # - 40650-40700:40650-40700
1916 volumes :
2017 - /dev/shm:/dev/shm
2118 privileged : true
@@ -25,7 +22,6 @@ services:
2522 - GRID=true
2623 - CHROME=false
2724 - FIREFOX=false
28- - MOCK_SERVER_HOST=mock
2925
3026 chrome :
3127 image : elgalu/selenium
@@ -35,6 +31,7 @@ services:
3531 # VNC: See what's going on by connecting your VNC client to 0.0.0.0:5900
3632 - 5900:25900
3733 # noVNC: See what's going on by hitting http://0.0.0.0:6080 in your browser
34+ # Important: http://127.0.0.1:6080 works but http://localhost:6080 doesn't
3835 - 6080:26080
3936 volumes :
4037 - /dev/shm:/dev/shm
@@ -44,11 +41,9 @@ services:
4441 - SELENIUM_HUB_HOST=hub
4542 - SELENIUM_HUB_PORT=4444
4643 - SELENIUM_NODE_HOST={{CONTAINER_IP}}
47- - VNC_FROM_PORT=${VNC_FROM_PORT-40650}
48- - VNC_TO_PORT=${VNC_TO_PORT-40700}
4944 - SCREEN_WIDTH=1300
5045 - SCREEN_HEIGHT=999
51- - VIDEO=${VIDEO- false}
46+ - VIDEO=false
5247 - GRID=false
5348 - CHROME=true
5449 - FIREFOX=false
@@ -70,19 +65,9 @@ services:
7065 - SELENIUM_HUB_HOST=hub
7166 - SELENIUM_HUB_PORT=4444
7267 - SELENIUM_NODE_HOST={{CONTAINER_IP}}
73- - VNC_FROM_PORT=${VNC_FROM_PORT-40650}
74- - VNC_TO_PORT=${VNC_TO_PORT-40700}
7568 - SCREEN_WIDTH=1300
7669 - SCREEN_HEIGHT=999
77- - VIDEO=${VIDEO- false}
70+ - VIDEO=false
7871 - GRID=false
7972 - CHROME=false
8073 - FIREFOX=true
81-
82- mock :
83- image : elgalu/google_adwords_mock
84- depends_on :
85- - hub
86- tty : true
87- environment :
88- - MOCK_SERVER_PORT=8280
0 commit comments