diff --git a/README.md b/README.md index 6281d0ae..e8569476 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,15 @@ Then run: Upon initial install, an example administrator user, example dataset, concept database, vocab and project are setup. The next session provides further details. +4\. (Optional), Environment variables are used to configure the app: + +|Parameter|Description| +|---------|-----------| +|MEDCAT_CONFIG_FILE|MedCAT config file as described [here](https://github.com/CogStack/MedCAT/blob/master/medcat/config.py)| +|BEHIND_RP| If you're running MedCATtrainer, use 1, othewise this defaults to 0 i.e. False| + + + # Administrator Setup diff --git a/docker-compose.yml b/docker-compose.yml index 185de9ca..63a446f2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ services: restart: always image: cogstacksystems/medcat-trainer:latest volumes: + - ./configs:/home/configs - api-media:/home/api/media - api-static:/home/api/static - api-db:/home/api/db diff --git a/envs/env b/envs/env index 271dcb0c..8bcb0637 100644 --- a/envs/env +++ b/envs/env @@ -1,2 +1 @@ -medcat_config_file=/home/configs/base.txt -behind_rp=0 \ No newline at end of file +MEDCAT_CONFIG_FILE=/home/configs/base.txt diff --git a/webapp/api/api/utils.py b/webapp/api/api/utils.py index 7565bb59..47803c4d 100644 --- a/webapp/api/api/utils.py +++ b/webapp/api/api/utils.py @@ -270,7 +270,7 @@ def get_medcat(CDB_MAP, VOCAB_MAP, CAT_MAP, project): else: cdb_path = project.concept_db.cdb_file.path cdb = CDB.load(cdb_path) - cdb.config.parse_config_file(path=os.getenv("medcat_config_file")) + cdb.config.parse_config_file(path=os.getenv("MEDCAT_CONFIG_FILE")) CDB_MAP[cdb_id] = cdb if vocab_id in VOCAB_MAP: diff --git a/webapp/api/api/views.py b/webapp/api/api/views.py index 0a8b9412..9f0bc254 100644 --- a/webapp/api/api/views.py +++ b/webapp/api/api/views.py @@ -619,4 +619,4 @@ def download_deployment(request): @api_view(http_method_names=['GET']) def behind_reverse_proxy(request): - return Response(bool(int(os.environ.get('behind_rp', False)))) + return Response(bool(int(os.environ.get('BEHIND_RP', False))))