codimd/deployments/docker-entrypoint.sh
BoHong Li 1f5b9813cb
feat: add new dockerfile
Signed-off-by: BoHong Li <raccoon@hackmd.io>
2019-10-07 15:42:03 +08:00

22 lines
350 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
if [[ "$#" -gt 0 ]]; then
exec "$@"
exit $?
fi
# check database and redis is ready
pcheck -constr "$CMD_DB_URL"
# run DB migrate
NEED_MIGRATE=${CMD_AUTO_MIGRATE:=true}
if [[ "$NEED_MIGRATE" = "true" ]] && [[ -f .sequelizerc ]] ; then
npx sequelize db:migrate
fi
# start application
node app.js