21 lines
740 B
Bash
21 lines
740 B
Bash
#!/usr/bin/env bash
|
|
# Start a virtual display, expose it over noVNC, then run the worker headful against it.
|
|
set -euo pipefail
|
|
|
|
DISPLAY_NUM="${DISPLAY:-:99}"
|
|
SCREEN="${SCREEN_GEOMETRY:-1440x900x24}"
|
|
|
|
echo "[entrypoint] starting Xvfb on ${DISPLAY_NUM} (${SCREEN})"
|
|
Xvfb "${DISPLAY_NUM}" -screen 0 "${SCREEN}" -nolisten tcp &
|
|
sleep 1
|
|
|
|
echo "[entrypoint] starting x11vnc (display ${DISPLAY_NUM} -> :5900)"
|
|
x11vnc -display "${DISPLAY_NUM}" -forever -shared -nopw -quiet -bg
|
|
|
|
echo "[entrypoint] starting noVNC on :6080 (open http://localhost:6080/vnc.html)"
|
|
websockify --web=/usr/share/novnc 6080 localhost:5900 &
|
|
|
|
WORKER_SCRIPT="${WORKER_SCRIPT:-csmoney_worker.py}"
|
|
echo "[entrypoint] launching ${WORKER_SCRIPT}"
|
|
exec python "${WORKER_SCRIPT}"
|