Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Commit a190874

Browse files
committed
Fix docker-compose examples for #192
1 parent 6836642 commit a190874

File tree

3 files changed

+70
-25
lines changed

3 files changed

+70
-25
lines changed

docker-compose-scales.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# The purpose of this -scales example is to run 1 hub, N chromes, N firefox
2+
#
3+
# Usage:
4+
# docker-compose -f docker-compose-scales.yml -p grid up --force-recreate
5+
# How to scale it:
6+
# docker-compose -f docker-compose-scales.yml -p grid scale hub=1 chrome=2 firefox=1
7+
version: '3'
8+
9+
services:
10+
hub:
11+
image: elgalu/selenium
12+
ports:
13+
- 4444:4444
14+
volumes:
15+
- /dev/shm:/dev/shm
16+
privileged: true
17+
environment:
18+
- SELENIUM_HUB_HOST=hub
19+
- SELENIUM_HUB_PORT=4444
20+
- GRID=true
21+
- CHROME=false
22+
- FIREFOX=false
23+
24+
chrome:
25+
image: elgalu/selenium
26+
depends_on:
27+
- hub
28+
volumes:
29+
- /dev/shm:/dev/shm
30+
privileged: true
31+
environment:
32+
- SELENIUM_HUB_HOST=hub
33+
- SELENIUM_HUB_PORT=4444
34+
- SELENIUM_NODE_HOST={{CONTAINER_IP}}
35+
- SCREEN_WIDTH=1300
36+
- SCREEN_HEIGHT=999
37+
- VIDEO=false
38+
- GRID=false
39+
- CHROME=true
40+
- FIREFOX=false
41+
42+
firefox:
43+
image: elgalu/selenium
44+
depends_on:
45+
- hub
46+
volumes:
47+
- /dev/shm:/dev/shm
48+
privileged: true
49+
environment:
50+
- SELENIUM_HUB_HOST=hub
51+
- SELENIUM_HUB_PORT=4444
52+
- SELENIUM_NODE_HOST={{CONTAINER_IP}}
53+
- SCREEN_WIDTH=1300
54+
- SCREEN_HEIGHT=999
55+
- VIDEO=false
56+
- GRID=false
57+
- CHROME=false
58+
- FIREFOX=true

docker-compose-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# The purpose of this -test example is for the e2e tests of this project
2+
#
13
# Usage:
24
# docker-compose -p grid up --force-recreate
35
# docker-compose -p grid scale mock=1 hub=1 chrome=3 firefox=3

docker-compose.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
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

611
services:
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

Comments
 (0)