diff --git a/docker/README.md b/docker/README.md index 736ac6ef..df0f7e7b 100644 --- a/docker/README.md +++ b/docker/README.md @@ -40,10 +40,11 @@ The following environment variables are available when using Docker Compose: | `WEB_HTTP_PORT` | 8080 | | `WEB_HTTPS_PORT` | 8443 | | `WEB_LOG_LEVEL` | info | -| `BACKEND_HOST` | backend | -| `BACKEND_PORT` | 6868 | -| `BACKEND_PASSWORD` | *[None]* | -| `BACKEND_LOG_LEVEL` | debug | +| `BACKEND_HOST` | backend | +| `BACKEND_PORT` | 6868 | +| `BACKEND_PASSWORD` | *[None]* | +| `BACKEND_LOG_LEVEL` | debug | +| `RESET_VENV` | *[None]* | **Examples:** @@ -57,6 +58,12 @@ Start the web UI with the log level set to debug: WEB_LOG_LEVEL=debug docker compose up ``` +Force resetting & reinstalling Python web `venv` directory: + +``` +RESET_VENV=1 docker compose up +``` + ## Volumes When using Docker Compose the following volumes will be mounted automatically: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index e3ea35a2..d18b8883 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -36,6 +36,7 @@ services: - "127.0.0.1:${WEB_HTTPS_PORT:-8443}:443" environment: - BACKEND_PASSWORD=${BACKEND_PASSWORD:-} + - RESET_VENV=${RESET_VENV:-} init: true command: [ "--backend-host=${BACKEND_HOST:-backend}", diff --git a/python/web/start.sh b/python/web/start.sh index 44a6ebed..09a3b1b7 100755 --- a/python/web/start.sh +++ b/python/web/start.sh @@ -36,6 +36,12 @@ if [ $ERROR = 1 ] ; then exit 1 fi +# Force rebuild the venv if RESET_VENV is set to any non-empty value +if [[ "$RESET_VENV" ]]; then + echo "Force-removing old venv" + sudo rm -rf venv +fi + # Test for two known broken venv states if test -e venv; then GOOD_VENV=true