codimd/deployments/docker-entrypoint.sh
BoHong Li f1594c56e2
feat: upgrade base image to resolve pcheck issues
1. upgrade node.js version from 8.16.0 to 8.16.2
2. upgrade pcheck to support connection string from environment
3. upgrade pcheck to fix connection string contains underscore might not resolve correctly

Signed-off-by: BoHong Li <raccoon@hackmd.io>
2019-11-28 15:57:31 +08:00

22 lines
344 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 -env 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