diff --git a/medcat-trainer/docker-compose-dev.yml b/medcat-trainer/docker-compose-dev.yml index abd3509d9..f90fce63f 100644 --- a/medcat-trainer/docker-compose-dev.yml +++ b/medcat-trainer/docker-compose-dev.yml @@ -24,6 +24,7 @@ services: - ./envs/env environment: - MCT_VERSION=latest + - MCT_DEV_LIVERELOAD=1 # OIDC Settings - USE_OIDC=0 - KEYCLOAK_URL=http://keycloak.cogstack.localhost diff --git a/medcat-trainer/webapp/scripts/run.sh b/medcat-trainer/webapp/scripts/run.sh index 9e343148c..7aac9d002 100755 --- a/medcat-trainer/webapp/scripts/run.sh +++ b/medcat-trainer/webapp/scripts/run.sh @@ -45,4 +45,11 @@ fi # RESET any Env vars to original stat export RESUBMIT_ALL_ON_STARTUP=$TMP_RESUBMIT_ALL_VAR -exec uv run uwsgi --http-timeout 360s --http :8000 --master --chdir /home/api/ --module core.wsgi +# Dev live-reload: runserver restarts and re-imports on file change; uWSGI py-autoreload only restarts workers (old code in memory). +if [ ${MCT_DEV_LIVERELOAD:-0} -eq 1 ]; then + echo "Starting with Django runserver (live reload)" + cd /home/api + exec uv run python manage.py runserver 0.0.0.0:8000 +else + exec uv run uwsgi --http-timeout 360s --http :8000 --master --chdir /home/api/ --module core.wsgi +fi