-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
42 lines (31 loc) · 1.33 KB
/
start.sh
File metadata and controls
42 lines (31 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
set -e
# Print a message
echo "Starting virtual display and VNC server..."
# Start Xvfb
Xvfb $DISPLAY -screen 0 $RESOLUTION &
echo "Xvfb started on display $DISPLAY"
# Give Xvfb a moment to start
sleep 2
# Start x11vnc
x11vnc -display $DISPLAY -forever -shared -nopw &
echo "x11vnc server started on port 5900"
# Start noVNC (HTML5 VNC client)
/usr/bin/websockify --web=/usr/share/novnc/ 6080 localhost:5900 &
echo "noVNC HTML5 client started on port 6080"
# Switch to the pointer user
su - pointer -c "DISPLAY=$DISPLAY chromium --no-sandbox --disable-gpu --disable-dev-shm-usage --disable-software-rasterizer --disable-setuid-sandbox --no-first-run --window-size=1920,1080 --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0" &
echo "Chromium browser started"
# Start the browser server
cd /browser
echo "Starting the browser server..."
python3 -m uvicorn server:app --host 0.0.0.0 --port 8000 &
echo "Browser server started on port 8000"
# Change back to /home/pointer as the working directory
cd /home/pointer
echo "Changed working directory to /home/pointer"
echo "Connect to VNC on port 5900 or use noVNC by pointing your browser to http://localhost:6080/vnc.html"
echo "Browser server API available at http://localhost:8000"
# Keep the container running
echo "Container is running. Press Ctrl+C to stop."
tail -f /dev/null