feat: harden containers and ci
This commit is contained in:
21
backend/docker-entrypoint.sh
Executable file
21
backend/docker-entrypoint.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
set -euo pipefail
|
||||
|
||||
RUN_MIGRATIONS="${RUN_MIGRATIONS:-true}"
|
||||
RUN_SEED="${RUN_SEED:-false}"
|
||||
|
||||
if [ "${SKIP_DB_WAIT:-false}" != "true" ]; then
|
||||
node ./scripts/wait-for-db.js
|
||||
fi
|
||||
|
||||
if [ "${RUN_MIGRATIONS}" = "true" ]; then
|
||||
echo ">> Running database migrations"
|
||||
npm run migrate
|
||||
fi
|
||||
|
||||
if [ "${RUN_SEED}" = "true" ]; then
|
||||
echo ">> Seeding database"
|
||||
npm run seed || true
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user