feat: update environment configuration and add script for rewriting dump URLs
This commit is contained in:
+9
-1
@@ -9,8 +9,11 @@ cd "$APP_DIR"
|
||||
mkdir -p logs static
|
||||
|
||||
if [ ! -f "$APP_DIR/db.sqlite3" ] && [ "${LOAD_FIXTURE_ON_EMPTY_DB:-true}" = "true" ]; then
|
||||
TMP_DUMP="$(mktemp)"
|
||||
python /app/scripts/rewrite_dumps.py dumps/example.json "$TMP_DUMP"
|
||||
python manage.py migrate
|
||||
python manage.py loaddata dumps/example.json
|
||||
python manage.py loaddata "$TMP_DUMP"
|
||||
rm -f "$TMP_DUMP"
|
||||
else
|
||||
python manage.py migrate
|
||||
fi
|
||||
@@ -19,4 +22,9 @@ fi
|
||||
# Collect them into STATIC_ROOT so the explicit /static/ URL can serve them.
|
||||
python manage.py collectstatic --noinput
|
||||
|
||||
if grep -aEq '127\.0\.0\.1|provider:8002' "$APP_DIR/db.sqlite3"; then
|
||||
echo "Refusing to start: bootstrap data still contains internal/local URLs" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec python manage.py runserver 0.0.0.0:"$PORT"
|
||||
|
||||
Reference in New Issue
Block a user