From fe77e1877a3864af57d4728e64b1e178be8b2f59 Mon Sep 17 00:00:00 2001 From: Vanessa Fotso Date: Thu, 26 Sep 2024 23:26:26 -0400 Subject: [PATCH] Add FHIRPath service to template Signed-off-by: Vanessa Fotso --- .env | 2 +- config/nginx.background.conf | 15 +++++++++++++++ docker-compose.background.yml | 1 + lib/inferno/apps/cli/templates/.env.development | 3 ++- lib/inferno/apps/cli/templates/.env.production | 3 ++- lib/inferno/apps/cli/templates/.env.test | 1 + .../cli/templates/config/nginx.background.conf.tt | 15 +++++++++++++++ .../templates/docker-compose.background.yml.tt | 5 +++++ .../apps/cli/templates/docker-compose.yml.tt | 4 ++++ 9 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.env b/.env index ef2424e7b..05b2dd3ec 100644 --- a/.env +++ b/.env @@ -3,7 +3,7 @@ VALIDATOR_URL=http://localhost/validatorapi REDIS_URL=redis://localhost:6379/0 G10_VALIDATOR_URL=http://localhost/validatorapi FHIR_RESOURCE_VALIDATOR_URL=http://localhost/hl7validatorapi -FHIRPATH_URL=http://localhost:6789 +FHIRPATH_URL=http://localhost/fhirpath # The base path where inferno will be hosted. Leave blank to host inferno at the # root of its host. diff --git a/config/nginx.background.conf b/config/nginx.background.conf index 1052b03e5..46b029f11 100644 --- a/config/nginx.background.conf +++ b/config/nginx.background.conf @@ -98,5 +98,20 @@ http { proxy_pass http://hl7_validator_service:3500/; } + + location /fhirpath/ { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; + proxy_redirect off; + proxy_set_header Connection ''; + proxy_http_version 1.1; + chunked_transfer_encoding off; + proxy_buffering off; + proxy_cache off; + + proxy_pass http://fhirpath:6789/; + } } } diff --git a/docker-compose.background.yml b/docker-compose.background.yml index 5e86234c3..0a44f91c1 100644 --- a/docker-compose.background.yml +++ b/docker-compose.background.yml @@ -21,6 +21,7 @@ services: command: [nginx, '-g', 'daemon off;'] depends_on: - fhir_validator_app + - fhirpath redis: image: redis ports: diff --git a/lib/inferno/apps/cli/templates/.env.development b/lib/inferno/apps/cli/templates/.env.development index e8690f6a4..38b28b344 100644 --- a/lib/inferno/apps/cli/templates/.env.development +++ b/lib/inferno/apps/cli/templates/.env.development @@ -1,2 +1,3 @@ FHIR_RESOURCE_VALIDATOR_URL=http://localhost/hl7validatorapi -REDIS_URL=redis://localhost:6379/0 \ No newline at end of file +REDIS_URL=redis://localhost:6379/0 +FHIRPATH_URL=http://localhost/fhirpath diff --git a/lib/inferno/apps/cli/templates/.env.production b/lib/inferno/apps/cli/templates/.env.production index 719b168be..727c9ae4c 100644 --- a/lib/inferno/apps/cli/templates/.env.production +++ b/lib/inferno/apps/cli/templates/.env.production @@ -1,2 +1,3 @@ REDIS_URL=redis://redis:6379/0 -FHIR_RESOURCE_VALIDATOR_URL=http://hl7_validator_service:3500 \ No newline at end of file +FHIR_RESOURCE_VALIDATOR_URL=http://hl7_validator_service:3500 +FHIRPATH_URL=http://fhirpath:6789 diff --git a/lib/inferno/apps/cli/templates/.env.test b/lib/inferno/apps/cli/templates/.env.test index 1545bfc1f..04d1a915d 100644 --- a/lib/inferno/apps/cli/templates/.env.test +++ b/lib/inferno/apps/cli/templates/.env.test @@ -1,2 +1,3 @@ FHIR_RESOURCE_VALIDATOR_URL=https://example.com/validatorapi ASYNC_JOBS=false +FHIRPATH_URL=https://example.com/fhirpath diff --git a/lib/inferno/apps/cli/templates/config/nginx.background.conf.tt b/lib/inferno/apps/cli/templates/config/nginx.background.conf.tt index 885866bb4..79446ed1a 100644 --- a/lib/inferno/apps/cli/templates/config/nginx.background.conf.tt +++ b/lib/inferno/apps/cli/templates/config/nginx.background.conf.tt @@ -98,5 +98,20 @@ http { proxy_pass http://hl7_validator_service:3500/; } + + location /fhirpath/ { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; + proxy_redirect off; + proxy_set_header Connection ''; + proxy_http_version 1.1; + chunked_transfer_encoding off; + proxy_buffering off; + proxy_cache off; + + proxy_pass http://fhirpath:6789/; + } } } diff --git a/lib/inferno/apps/cli/templates/docker-compose.background.yml.tt b/lib/inferno/apps/cli/templates/docker-compose.background.yml.tt index 8bce4dc0b..934ee0ea6 100644 --- a/lib/inferno/apps/cli/templates/docker-compose.background.yml.tt +++ b/lib/inferno/apps/cli/templates/docker-compose.background.yml.tt @@ -23,6 +23,10 @@ services: environment: EXTERNAL_VALIDATOR_URL: http://localhost/validatorapi VALIDATOR_BASE_PATH: /validator + fhirpath: + image: infernocommunity/fhirpath-service + ports: + - "6789:6789" nginx: image: nginx volumes: @@ -32,6 +36,7 @@ services: command: [nginx, '-g', 'daemon off;'] depends_on: - fhir_validator_app + - fhirpath redis: image: redis ports: diff --git a/lib/inferno/apps/cli/templates/docker-compose.yml.tt b/lib/inferno/apps/cli/templates/docker-compose.yml.tt index eaa6736ce..d9daa73ff 100644 --- a/lib/inferno/apps/cli/templates/docker-compose.yml.tt +++ b/lib/inferno/apps/cli/templates/docker-compose.yml.tt @@ -27,6 +27,10 @@ services: extends: file: docker-compose.background.yml service: fhir_validator_app + fhirpath: + extends: + file: docker-compose.background.yml + service: fhirpath nginx: extends: file: docker-compose.background.yml