From 3d60783d1e529f57876794462ef2d7cc0ca3ac06 Mon Sep 17 00:00:00 2001 From: "Kipchumba C. Bett" Date: Tue, 24 Sep 2024 14:56:25 +0300 Subject: [PATCH] OZ-708: Add fhir-odoo sidecar service --- docker-compose-odoo.yml | 27 +++++++++++++++++++++++++++ docker-compose-openmrs.yml | 1 + proxy/default.conf.template | 9 +++++++++ proxy/docker-compose.yml | 1 + scripts/utils.sh | 8 ++++++++ 5 files changed, 46 insertions(+) diff --git a/docker-compose-odoo.yml b/docker-compose-odoo.yml index 4fb096d..8a6692f 100644 --- a/docker-compose-odoo.yml +++ b/docker-compose-odoo.yml @@ -98,6 +98,30 @@ services: volumes: - "${EIP_ODOO_OPENMRS_ROUTES_PATH}:/eip-client/routes" - eip-home-odoo:/eip-home + + fhir-odoo: + depends_on: + env-substitution: + condition: service_completed_successfully + odoo: + condition: service_started + environment: + - ODOO_HOST=odoo + - ODOO_PORT=8069 + - ODOO_RPC_PROTOCOL=${ODOO_RPC_PROTOCOL} + - ODOO_DATABASE=${ODOO_DATABASE} + image: mekomsolutions/fhir-odoo + labels: + traefik.enable: "true" + traefik.http.routers.fhir-odoo.rule: "Host(`${FHIR_ODOO_HOSTNAME}`)" + traefik.http.routers.fhir-odoo.entrypoints: "websecure" + traefik.http.services.fhir-odoo.loadbalancer.server.port: 8080 + networks: + ozone: + aliases: + - fhir-odoo + - odoo-fhir-facade + restart: unless-stopped postgresql: environment: @@ -118,6 +142,9 @@ services: env-substitution: environment: - ODOO_PUBLIC_URL=https://${ODOO_HOSTNAME} + - FHIR_ODOO_PUBLIC_URL=${ODOO_RPC_PROTOCOL}://${FHIR_ODOO_HOSTNAME} + - ODOO_USER=${ODOO_USER} + - ODOO_PASSWORD=${ODOO_PASSWORD} volumes: eip-home-odoo: ~ diff --git a/docker-compose-openmrs.yml b/docker-compose-openmrs.yml index c84ac09..c991e3f 100644 --- a/docker-compose-openmrs.yml +++ b/docker-compose-openmrs.yml @@ -43,6 +43,7 @@ services: - "${OPENMRS_CONFIG_PATH:-openmrs-config}:/openmrs/distribution/openmrs_config/" - "${OPENMRS_CONFIG_CHECKSUMS_PATH:-openmrs-config-checksums}:/openmrs/data/configuration_checksums" - "${OPENMRS_PROPERTIES_PATH}:/etc/properties/" + - "${OPENMRS_PROPERTIES_PATH}/fhir-proxy.properties:/openmrs/data/fhirproxy/config.properties" # OpenMRS 3 Frontend frontend: diff --git a/proxy/default.conf.template b/proxy/default.conf.template index 7c13e14..0ac9a07 100644 --- a/proxy/default.conf.template +++ b/proxy/default.conf.template @@ -168,3 +168,12 @@ server { proxy_pass http://$erpnext; } } + +server { + listen 8083; + location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://fhir-odoo:8080; + } +} diff --git a/proxy/docker-compose.yml b/proxy/docker-compose.yml index e474857..ce5d854 100644 --- a/proxy/docker-compose.yml +++ b/proxy/docker-compose.yml @@ -24,6 +24,7 @@ services: - "8081:8081" - "8088:8088" - "8082:8082" + - "8083:8083" volumes: - "./confs:/usr/local/apache2/conf/extra" - "${PROXY_TLS_CERTS_PATH:-proxy-tls-certs}:/etc/tls" diff --git a/scripts/utils.sh b/scripts/utils.sh index fd97c20..c651d1a 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -106,10 +106,14 @@ function setTraefikHostnames { export ODOO_HOSTNAME=erp-"${IP_WITH_DASHES}.traefik.me" export SENAITE_HOSTNAME=lims-"${IP_WITH_DASHES}.traefik.me" export ERPNEXT_HOSTNAME=erpnext-"${IP_WITH_DASHES}.traefik.me" + export FHIR_ODOO_HOSTNAME=fhir-erp-"${IP_WITH_DASHES}.traefik.me" + export ODOO_RPC_PROTOCOL="https" echo "→ O3_HOSTNAME=$O3_HOSTNAME" echo "→ ODOO_HOSTNAME=$ODOO_HOSTNAME" echo "→ SENAITE_HOSTNAME=$SENAITE_HOSTNAME" echo "→ ERPNEXT_HOSTNAME=$ERPNEXT_HOSTNAME" + echo "→ FHIR_ODOO_HOSTNAME=$FHIR_ODOO_HOSTNAME" + echo "→ ODOO_RPC_PROTOCOL=$ODOO_RPC_PROTOCOL" } @@ -120,10 +124,14 @@ function setNginxHostnames { export ODOO_HOSTNAME="localhost:8069" export SENAITE_HOSTNAME="localhost:8081" export ERPNEXT_HOSTNAME="localhost:8082" + export FHIR_ODOO_HOSTNAME="localhost:8083" + export ODOO_RPC_PROTOCOL="http" echo "→ O3_HOSTNAME=$O3_HOSTNAME" echo "→ ODOO_HOSTNAME=$ODOO_HOSTNAME" echo "→ SENAITE_HOSTNAME=$SENAITE_HOSTNAME" echo "→ ERPNEXT_HOSTNAME=$ERPNEXT_HOSTNAME" + echo "→ FHIR_ODOO_HOSTNAME=$FHIR_ODOO_HOSTNAME" + echo "→ ODOO_RPC_PROTOCOL=$ODOO_RPC_PROTOCOL" }