Skip to content

Commit a7a649e

Browse files
committed
Add docker-compose file for reference [skip ci]
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 16d24ab commit a7a649e

12 files changed

+163
-15
lines changed

Base/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ ENV SE_BIND_HOST=false \
175175
SE_SUPERVISORD_CHILD_LOG_DIR="/tmp" \
176176
SE_SUPERVISORD_LOG_FILE="/tmp/supervisord.log" \
177177
SE_SUPERVISORD_PID_FILE="/tmp/supervisord.pid" \
178+
SE_SUPERVISORD_AUTO_RESTART=true \
179+
SE_SUPERVISORD_START_RETRIES=5 \
178180
SE_LOG_TIMESTAMP_FORMAT="%Y-%m-%d %H:%M:%S,%3N" \
179181
SE_LOG_LEVEL="INFO" \
180182
SE_HTTP_LOGS=false \

Distributor/selenium-grid-distributor.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-distributor.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

EventBus/selenium-grid-eventbus.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-eventbus.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

Hub/selenium-grid-hub.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-hub.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

Router/selenium-grid-router.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-router.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

SessionQueue/selenium-grid-session-queue.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-session-queue.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

Sessions/init.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE TABLE IF NOT EXISTS sessions_map(
2+
session_ids varchar(256),
3+
session_caps text,
4+
session_uri varchar(256),
5+
session_stereotype text,
6+
session_start varchar(256)
7+
);

Sessions/selenium-grid-sessions.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-sessions.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

docker-compose-v2-tracing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
version: '2'
55
services:
66
jaeger:
7-
image: jaegertracing/all-in-one:1.60
7+
image: jaegertracing/all-in-one:latest
88
ports:
99
- "16686:16686"
1010
- "4317:4317"
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-full-grid.yml up`
2+
# Add the `-d` flag at the end for detached execution
3+
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-full-grid.yml down`
4+
version: "3"
5+
services:
6+
selenium-event-bus:
7+
image: selenium/event-bus:4.27.0-20241127
8+
container_name: selenium-event-bus
9+
environment:
10+
- SE_ENABLE_TRACING=false
11+
ports:
12+
- "4442:4442"
13+
- "4443:4443"
14+
- "5557:5557"
15+
16+
selenium-sessions:
17+
image: selenium/sessions:4.27.0-20241127
18+
container_name: selenium-sessions
19+
ports:
20+
- "5556:5556"
21+
depends_on:
22+
- selenium-event-bus
23+
environment:
24+
- SE_EVENT_BUS_HOST=selenium-event-bus
25+
- SE_EVENT_BUS_PUBLISH_PORT=4442
26+
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
27+
- SE_ENABLE_TRACING=false
28+
- SE_SESSIONS_MAP_EXTERNAL_DATASTORE=true
29+
- SE_SESSIONS_MAP_EXTERNAL_IMPLEMENTATION=org.openqa.selenium.grid.sessionmap.jdbc.JdbcBackedSessionMap
30+
- SE_SESSIONS_MAP_EXTERNAL_JDBC_URL=jdbc:postgresql://postgresql:5432/selenium_sessions
31+
- SE_SESSIONS_MAP_EXTERNAL_JDBC_USER=seluser
32+
- SE_SESSIONS_MAP_EXTERNAL_JDBC_PASSWORD=seluser
33+
# Uncomment the following lines to use Redis as the external datastore
34+
# - SE_SESSIONS_MAP_EXTERNAL_SCHEME=redis
35+
# - SE_SESSIONS_MAP_EXTERNAL_IMPLEMENTATION=org.openqa.selenium.grid.sessionmap.redis.RedisBackedSessionMap
36+
# - SE_SESSIONS_MAP_EXTERNAL_HOSTNAME=redis
37+
# - SE_SESSIONS_MAP_EXTERNAL_PORT=6379
38+
39+
postgresql:
40+
image: postgres:latest
41+
restart: always
42+
environment:
43+
- POSTGRES_USER=seluser
44+
- POSTGRES_PASSWORD=seluser
45+
- POSTGRES_DB=selenium_sessions
46+
ports:
47+
- "5432:5432"
48+
volumes:
49+
- ./Sessions/init.sql:/docker-entrypoint-initdb.d/init.sql
50+
51+
redis:
52+
image: redis:latest
53+
restart: always
54+
ports:
55+
- "6379:6379"
56+
57+
selenium-session-queue:
58+
image: selenium/session-queue:4.27.0-20241127
59+
container_name: selenium-session-queue
60+
environment:
61+
- SE_ENABLE_TRACING=false
62+
ports:
63+
- "5559:5559"
64+
65+
selenium-distributor:
66+
image: selenium/distributor:4.27.0-20241127
67+
container_name: selenium-distributor
68+
ports:
69+
- "5553:5553"
70+
depends_on:
71+
- selenium-event-bus
72+
- selenium-sessions
73+
- selenium-session-queue
74+
environment:
75+
- SE_EVENT_BUS_HOST=selenium-event-bus
76+
- SE_EVENT_BUS_PUBLISH_PORT=4442
77+
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
78+
- SE_SESSIONS_MAP_HOST=selenium-sessions
79+
- SE_SESSIONS_MAP_PORT=5556
80+
- SE_SESSION_QUEUE_HOST=selenium-session-queue
81+
- SE_SESSION_QUEUE_PORT=5559
82+
- SE_ENABLE_TRACING=false
83+
84+
selenium-router:
85+
image: selenium/router:4.27.0-20241127
86+
container_name: selenium-router
87+
ports:
88+
- "4444:4444"
89+
depends_on:
90+
- selenium-distributor
91+
- selenium-sessions
92+
- selenium-session-queue
93+
environment:
94+
- SE_DISTRIBUTOR_HOST=selenium-distributor
95+
- SE_DISTRIBUTOR_PORT=5553
96+
- SE_SESSIONS_MAP_HOST=selenium-sessions
97+
- SE_SESSIONS_MAP_PORT=5556
98+
- SE_SESSION_QUEUE_HOST=selenium-session-queue
99+
- SE_SESSION_QUEUE_PORT=5559
100+
- SE_ENABLE_TRACING=false
101+
102+
chrome:
103+
image: selenium/node-chrome:4.27.0-20241127
104+
shm_size: 2gb
105+
depends_on:
106+
- selenium-event-bus
107+
environment:
108+
- SE_EVENT_BUS_HOST=selenium-event-bus
109+
- SE_EVENT_BUS_PUBLISH_PORT=4442
110+
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
111+
- SE_ENABLE_TRACING=false
112+
113+
edge:
114+
image: selenium/node-edge:4.27.0-20241127
115+
shm_size: 2gb
116+
depends_on:
117+
- selenium-event-bus
118+
environment:
119+
- SE_EVENT_BUS_HOST=selenium-event-bus
120+
- SE_EVENT_BUS_PUBLISH_PORT=4442
121+
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
122+
- SE_ENABLE_TRACING=false
123+
124+
firefox:
125+
image: selenium/node-firefox:4.27.0-20241127
126+
shm_size: 2gb
127+
depends_on:
128+
- selenium-event-bus
129+
environment:
130+
- SE_EVENT_BUS_HOST=selenium-event-bus
131+
- SE_EVENT_BUS_PUBLISH_PORT=4442
132+
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
133+
- SE_ENABLE_TRACING=false

0 commit comments

Comments
 (0)