#!/bin/sh
# Publish the bundled index.html into the (typically bind-mounted) /static
# directory so the host's web server can pick it up, then start the
# signaling server. Always overwrites so a rebuilt image updates the file.
set -e
if [ -d /static ] && [ -w /static ]; then
    cp -f /opt/static/index.html /static/index.html
fi
exec /usr/local/bin/signal "${PORT:-8080}"
