Skip to content

Commit

Permalink
Add docker-compose file for reference [skip ci]
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Dec 3, 2024
1 parent 16d24ab commit a7a649e
Show file tree
Hide file tree
Showing 12 changed files with 163 additions and 15 deletions.
2 changes: 2 additions & 0 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ ENV SE_BIND_HOST=false \
SE_SUPERVISORD_CHILD_LOG_DIR="/tmp" \
SE_SUPERVISORD_LOG_FILE="/tmp/supervisord.log" \
SE_SUPERVISORD_PID_FILE="/tmp/supervisord.pid" \
SE_SUPERVISORD_AUTO_RESTART=true \
SE_SUPERVISORD_START_RETRIES=5 \
SE_LOG_TIMESTAMP_FORMAT="%Y-%m-%d %H:%M:%S,%3N" \
SE_LOG_LEVEL="INFO" \
SE_HTTP_LOGS=false \
Expand Down
5 changes: 3 additions & 2 deletions Distributor/selenium-grid-distributor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
priority=0
command=/opt/bin/start-selenium-grid-distributor.sh
autostart=true
autorestart=false
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
startsecs=0
startretries=0
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
stopsignal=TERM

;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
redirect_stderr=true
Expand Down
5 changes: 3 additions & 2 deletions EventBus/selenium-grid-eventbus.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
priority=0
command=/opt/bin/start-selenium-grid-eventbus.sh
autostart=true
autorestart=false
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
startsecs=0
startretries=0
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
stopsignal=TERM

;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
redirect_stderr=true
Expand Down
5 changes: 3 additions & 2 deletions Hub/selenium-grid-hub.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
priority=0
command=/opt/bin/start-selenium-grid-hub.sh
autostart=true
autorestart=false
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
startsecs=0
startretries=0
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
stopsignal=TERM

;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
redirect_stderr=true
Expand Down
5 changes: 3 additions & 2 deletions Router/selenium-grid-router.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
priority=0
command=/opt/bin/start-selenium-grid-router.sh
autostart=true
autorestart=false
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
startsecs=0
startretries=0
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
stopsignal=TERM

;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
redirect_stderr=true
Expand Down
5 changes: 3 additions & 2 deletions SessionQueue/selenium-grid-session-queue.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
priority=0
command=/opt/bin/start-selenium-grid-session-queue.sh
autostart=true
autorestart=false
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
startsecs=0
startretries=0
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
stopsignal=TERM

;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
redirect_stderr=true
Expand Down
7 changes: 7 additions & 0 deletions Sessions/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS sessions_map(
session_ids varchar(256),
session_caps text,
session_uri varchar(256),
session_stereotype text,
session_start varchar(256)
);
5 changes: 3 additions & 2 deletions Sessions/selenium-grid-sessions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
priority=0
command=/opt/bin/start-selenium-grid-sessions.sh
autostart=true
autorestart=false
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
startsecs=0
startretries=0
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
stopsignal=TERM

;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
redirect_stderr=true
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-v2-tracing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
version: '2'
services:
jaeger:
image: jaegertracing/all-in-one:1.60
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686"
- "4317:4317"
Expand Down
133 changes: 133 additions & 0 deletions docker-compose-v3-full-grid-external-datastore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-full-grid.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-full-grid.yml down`
version: "3"
services:
selenium-event-bus:
image: selenium/event-bus:4.27.0-20241127
container_name: selenium-event-bus
environment:
- SE_ENABLE_TRACING=false
ports:
- "4442:4442"
- "4443:4443"
- "5557:5557"

selenium-sessions:
image: selenium/sessions:4.27.0-20241127
container_name: selenium-sessions
ports:
- "5556:5556"
depends_on:
- selenium-event-bus
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
- SE_ENABLE_TRACING=false
- SE_SESSIONS_MAP_EXTERNAL_DATASTORE=true
- SE_SESSIONS_MAP_EXTERNAL_IMPLEMENTATION=org.openqa.selenium.grid.sessionmap.jdbc.JdbcBackedSessionMap
- SE_SESSIONS_MAP_EXTERNAL_JDBC_URL=jdbc:postgresql://postgresql:5432/selenium_sessions
- SE_SESSIONS_MAP_EXTERNAL_JDBC_USER=seluser
- SE_SESSIONS_MAP_EXTERNAL_JDBC_PASSWORD=seluser
# Uncomment the following lines to use Redis as the external datastore
# - SE_SESSIONS_MAP_EXTERNAL_SCHEME=redis
# - SE_SESSIONS_MAP_EXTERNAL_IMPLEMENTATION=org.openqa.selenium.grid.sessionmap.redis.RedisBackedSessionMap
# - SE_SESSIONS_MAP_EXTERNAL_HOSTNAME=redis
# - SE_SESSIONS_MAP_EXTERNAL_PORT=6379

postgresql:
image: postgres:latest
restart: always
environment:
- POSTGRES_USER=seluser
- POSTGRES_PASSWORD=seluser
- POSTGRES_DB=selenium_sessions
ports:
- "5432:5432"
volumes:
- ./Sessions/init.sql:/docker-entrypoint-initdb.d/init.sql

redis:
image: redis:latest
restart: always
ports:
- "6379:6379"

selenium-session-queue:
image: selenium/session-queue:4.27.0-20241127
container_name: selenium-session-queue
environment:
- SE_ENABLE_TRACING=false
ports:
- "5559:5559"

selenium-distributor:
image: selenium/distributor:4.27.0-20241127
container_name: selenium-distributor
ports:
- "5553:5553"
depends_on:
- selenium-event-bus
- selenium-sessions
- selenium-session-queue
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
- SE_SESSIONS_MAP_HOST=selenium-sessions
- SE_SESSIONS_MAP_PORT=5556
- SE_SESSION_QUEUE_HOST=selenium-session-queue
- SE_SESSION_QUEUE_PORT=5559
- SE_ENABLE_TRACING=false

selenium-router:
image: selenium/router:4.27.0-20241127
container_name: selenium-router
ports:
- "4444:4444"
depends_on:
- selenium-distributor
- selenium-sessions
- selenium-session-queue
environment:
- SE_DISTRIBUTOR_HOST=selenium-distributor
- SE_DISTRIBUTOR_PORT=5553
- SE_SESSIONS_MAP_HOST=selenium-sessions
- SE_SESSIONS_MAP_PORT=5556
- SE_SESSION_QUEUE_HOST=selenium-session-queue
- SE_SESSION_QUEUE_PORT=5559
- SE_ENABLE_TRACING=false

chrome:
image: selenium/node-chrome:4.27.0-20241127
shm_size: 2gb
depends_on:
- selenium-event-bus
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
- SE_ENABLE_TRACING=false

edge:
image: selenium/node-edge:4.27.0-20241127
shm_size: 2gb
depends_on:
- selenium-event-bus
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
- SE_ENABLE_TRACING=false

firefox:
image: selenium/node-firefox:4.27.0-20241127
shm_size: 2gb
depends_on:
- selenium-event-bus
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
- SE_ENABLE_TRACING=false
2 changes: 1 addition & 1 deletion docker-compose-v3-full-grid-tracing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
version: "3"
services:
jaeger:
image: jaegertracing/all-in-one:1.60
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686"
- "4317:4317"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-v3-tracing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
version: "3"
services:
jaeger:
image: jaegertracing/all-in-one:1.60
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686"
- "4317:4317"
Expand Down

0 comments on commit a7a649e

Please sign in to comment.