diff --git a/configure.py b/configure.py index 6b0309f..0d79e8d 100755 --- a/configure.py +++ b/configure.py @@ -31,6 +31,7 @@ def generate_docker_compose( ip: str, develop: bool = False, live_model: bool = False, + version: str = "", ) -> None: """Generate the docker-compose.yml file. @@ -42,6 +43,7 @@ def generate_docker_compose( develop: Flag for when running in develop mode (localhost for datahub). live_model: Flag for when running with a live model. This requires an available connection to a datahub, either in production or local for develop. + version: The version of the image to use. Returns: None @@ -92,7 +94,7 @@ def generate_docker_compose( docker_compose["services"]["dash"]["environment"]["PRODUCTION"] = "true" docker_compose["services"]["dash"][ "image" - ] = "ghcr.io/imperialcollegelondon/gridlington-vis:latest" + ] = f"ghcr.io/imperialcollegelondon/gridlington-vis:{version if version else 'latest'}" # noqa: E501 if live_model: docker_compose["services"]["dash"]["environment"]["LIVE_MODEL"] = "true" @@ -116,4 +118,7 @@ def generate_docker_compose( ip, develop="develop" in sys.argv, live_model="live_model" in sys.argv, + version=( + sys.argv[sys.argv.index("version") + 1] if "version" in sys.argv else "" + ), ) diff --git a/run_stable.sh b/run_stable.sh new file mode 100644 index 0000000..7e852a5 --- /dev/null +++ b/run_stable.sh @@ -0,0 +1,2 @@ +python3 configure.py version v0.3.2 +docker-compose up -d