From 256d19a2cc76b02c59d2dedc6e8516592ab65cf1 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Fri, 30 Jan 2026 12:45:11 -0600 Subject: [PATCH] Move legacy numpy install to after init-dev. UV replaces. --- docker/entrypoint.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index ff8a193f..0f8f5f88 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -27,18 +27,6 @@ echo_with_timestamp() { echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" } -# --- NumPy version switching for legacy hardware --- -if [ "$USE_LEGACY_NUMPY" = "true" ]; then - # Check if NumPy was compiled with baseline support - if $VIRTUAL_ENV/bin/python -c "import numpy; numpy.show_config()" 2>&1 | grep -qi "baseline"; then - echo_with_timestamp "🔧 Switching to legacy NumPy (no CPU baseline)..." - uv pip install --python $VIRTUAL_ENV/bin/python --no-cache --force-reinstall --no-deps /opt/numpy-*.whl - echo_with_timestamp "✅ Legacy NumPy installed" - else - echo_with_timestamp "✅ Legacy NumPy (no baseline) already installed, skipping reinstallation" - fi -fi - # Set PostgreSQL environment variables export POSTGRES_DB=${POSTGRES_DB:-dispatcharr} export POSTGRES_USER=${POSTGRES_USER:-dispatch} @@ -186,6 +174,19 @@ else pids+=("$nginx_pid") fi + +# --- NumPy version switching for legacy hardware --- +if [ "$USE_LEGACY_NUMPY" = "true" ]; then + # Check if NumPy was compiled with baseline support + if $VIRTUAL_ENV/bin/python -c "import numpy; numpy.show_config()" 2>&1 | grep -qi "baseline"; then + echo_with_timestamp "🔧 Switching to legacy NumPy (no CPU baseline)..." + uv pip install --python $VIRTUAL_ENV/bin/python --no-cache --force-reinstall --no-deps /opt/numpy-*.whl + echo_with_timestamp "✅ Legacy NumPy installed" + else + echo_with_timestamp "✅ Legacy NumPy (no baseline) already installed, skipping reinstallation" + fi +fi + # Run Django commands as non-root user to prevent permission issues su - $POSTGRES_USER -c "cd /app && python manage.py migrate --noinput" su - $POSTGRES_USER -c "cd /app && python manage.py collectstatic --noinput"