#!/bin/sh # # WyOJ web container entrypoint. # # First start (no /var/uoj_data/.UOJSetupDone) runs the installer, which writes # app/.config.php from the environment and waits for the database. Later # starts go straight to apache, so recreating the container is cheap. set -e if [ ! -f /var/uoj_data/.UOJSetupDone ]; then echo "==> first start: running install.sh -i" bash /opt/uoj/web/install.sh -i else echo "==> install already done, skipping" fi # ntp needs CAP_SYS_TIME, which containers normally do not have -- never fail. service ntp start >/dev/null 2>&1 || true echo "==> starting apache" exec apachectl -D FOREGROUND