Trying to modify run.sh so it waits for the Xvfb server to start accepting connections.
This commit is contained in:
parent
5dab9a3939
commit
29bd8d2fe8
1 changed files with 7 additions and 3 deletions
4
run.sh
4
run.sh
|
@ -20,10 +20,14 @@ if [ "${port}" != "" ]; then
|
||||||
|
|
||||||
# Wait to be able to connect to the port. This will exit if it cannot in 15 minutes.
|
# Wait to be able to connect to the port. This will exit if it cannot in 15 minutes.
|
||||||
timeout 15 bash -c "while ! nc -z localhost ${port}; do sleep 0.5; done"
|
timeout 15 bash -c "while ! nc -z localhost ${port}; do sleep 0.5; done"
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
export DISPLAY=:${port}.0
|
export DISPLAY=:${port}.0
|
||||||
|
|
||||||
cd /data
|
cd /data
|
||||||
node /usr/src/app/ -p 80 "$@"
|
node /usr/src/app/ -p 80 "$@"
|
||||||
|
else
|
||||||
|
echo "Could not connect to display port ${port} in 15 seconds time."
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Could not get a display port."
|
echo "Could not get a display port."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue