likhonsheikh commited on
Commit
da2fbc1
·
verified ·
1 Parent(s): f9f77ec

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -16
Dockerfile CHANGED
@@ -1,24 +1,22 @@
1
- # Official Selenium standalone with Chrome + Firefox and noVNC
2
- FROM selenium/standalone-docker:latest
3
 
4
- # Set timezone for consistency
5
  ENV TZ=UTC
6
 
7
- # Grid & Node config
8
- ENV SE_EVENT_BUS_HOST=localhost
9
- ENV SE_EVENT_BUS_PUBLISH_PORT=4442
10
- ENV SE_EVENT_BUS_SUBSCRIBE_PORT=4443
11
- ENV SE_NODE_MAX_SESSIONS=5
12
- ENV SE_NODE_SESSION_TIMEOUT=300
13
 
14
- # Enable noVNC for direct browser control
 
 
15
  ENV SE_VNC_NO_PASSWORD=1
16
- ENV SE_SCREEN_WIDTH=1920
17
- ENV SE_SCREEN_HEIGHT=1080
18
  ENV SE_SCREEN_DEPTH=24
19
 
20
- # Expose WebDriver and VNC/noVNC ports
21
- EXPOSE 4444 7900 5900
22
 
23
- # Default CMD runs Selenium Grid (hub + nodes + VNC)
24
- CMD ["selenium-standalone"]
 
1
+ # Smaller base: only Chrome, Grid + noVNC
2
+ FROM selenium/standalone-chrome:latest
3
 
4
+ # Set timezone
5
  ENV TZ=UTC
6
 
7
+ # Hugging Face expects your app to listen on this port
8
+ ENV APP_PORT=7900
 
 
 
 
9
 
10
+ # Selenium config
11
+ ENV SE_NODE_MAX_SESSIONS=1
12
+ ENV SE_NODE_SESSION_TIMEOUT=300
13
  ENV SE_VNC_NO_PASSWORD=1
14
+ ENV SE_SCREEN_WIDTH=1280
15
+ ENV SE_SCREEN_HEIGHT=720
16
  ENV SE_SCREEN_DEPTH=24
17
 
18
+ # Hugging Face only exposes one port, so we run noVNC there
19
+ EXPOSE ${APP_PORT}
20
 
21
+ # Start Selenium and noVNC on the same port
22
+ CMD ["bash", "-c", "SE_VNC_PORT=${APP_PORT} /opt/bin/entry_point.sh"]