Skip to content

Commit

Permalink
Add README edits for env vars, add configs bind mount
Browse files Browse the repository at this point in the history
  • Loading branch information
tomolopolis committed Apr 15, 2021
1 parent 6a18030 commit 575a1bd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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|



<a name="admin-setup"></a>
# Administrator Setup

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions envs/env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
medcat_config_file=/home/configs/base.txt
behind_rp=0
MEDCAT_CONFIG_FILE=/home/configs/base.txt
2 changes: 1 addition & 1 deletion webapp/api/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion webapp/api/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))))

0 comments on commit 575a1bd

Please sign in to comment.