mirror of
https://github.com/Lissy93/web-check.git
synced 2025-05-01 04:44:27 +02:00
. Dockerfile optimization (reorder) . Docker: Add xvfb package . Docker: Add entrypoint.sh . Launch dbus at container start (entrypoint.sh) . Lauch Xvfb at container start (entrypoint.sh) . Above fix screenshot error on docker . Add environment variables: . . SCREEN_RESOLUTION: for Xvfb resolution . . BROWSER_WIDTH: for screenshot . . BROWSER_HEIGHT: for screenshot . . BROWSER_TIMEOUT: for screenshot
13 lines
417 B
Bash
Executable File
13 lines
417 B
Bash
Executable File
#!/usr/bin/env bash
|
|
SCREEN_RESOLUTION="${SCREEN_RESOLUTION:-1280x1024x24}"
|
|
if [[ ! "${SCREEN_RESOLUTION}" =~ ^[0-9]+x[0-9]+x(8|16|24)$ ]]; then
|
|
echo "SCREEN_RESOLUTION must match screen resolution like '1280x1024x24'"
|
|
echo "last number (color) must be 8,16 or 24"
|
|
exit 1
|
|
fi
|
|
|
|
service dbus start
|
|
[[ -z "${DISPLAY}" ]] && export DISPLAY=":99"
|
|
Xvfb "${DISPLAY}" -screen 0 "${SCREEN_RESOLUTION}" &
|
|
exec "${@}"
|