diff --git a/.env b/.env index 2125035..1329bb7 100644 --- a/.env +++ b/.env @@ -9,4 +9,5 @@ CR_FHIR_PORT=8081 CR_ES_PORT=9200 OPENHIM_PORT=9201 - +SHR_VERSION=v0.4.4 +FHIR_CONVERTER_VERSION=v3.1.4 \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e44ec7..c1383dc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,29 +49,19 @@ jobs: - name: Display logs run: docker-compose -f docker-compose.ci.yml --profile mediators logs - - name: Run General Tests (https://openme.postman.co/workspace/Botswana-HIE~bf140db5-85f6-4470-bc3a-511efcda80ba/collection/1525496-77f89792-c73b-4c75-a450-5cb6f79230d4) + - name: Run General Tests https://www.postman.com/itechuw/workspace/botswana-hie/collection/1525496-77f89792-c73b-4c75-a450-5cb6f79230d4) env: POSTMAN_COLLECTION: https://www.getpostman.com/collections/c58de2e03b071c45dcaa run: docker-compose --profile test -f docker-compose.ci.yml up --exit-code-from newman newman - - name: Run CR Tests (https://openme.postman.co/workspace/Botswana-HIE~bf140db5-85f6-4470-bc3a-511efcda80ba/collection/1525496-16a5a3c2-719f-40a6-ad06-a9530d3f2006) + - name: Run CR Tests (https://www.postman.com/itechuw/workspace/botswana-hie/collection/1525496-16a5a3c2-719f-40a6-ad06-a9530d3f2006) env: POSTMAN_COLLECTION: https://www.getpostman.com/collections/a410a87102b64366c072 run: docker-compose --profile test -f docker-compose.ci.yml up --exit-code-from newman newman - - name: Run Laboratory Tests (https://openme.postman.co/workspace/Botswana-HIE~bf140db5-85f6-4470-bc3a-511efcda80ba/collection/1525496-fc0b7d4c-90b3-4774-9156-3e6cb4c97f5f) + - name: Run Laboratory Tests (https://www.postman.com/itechuw/workspace/botswana-hie/collection/1525496-db80feab-8a77-42c8-aa7e-fd4beb0ae6a8) env: - POSTMAN_COLLECTION: https://www.getpostman.com/collections/ff5183adca5b5e720338 - run: docker-compose --profile test -f docker-compose.ci.yml up --exit-code-from newman newman - - - name: Run HL7 <--> FHIR Tests (https://openme.postman.co/workspace/Botswana-HIE~bf140db5-85f6-4470-bc3a-511efcda80ba/collection/1525496-6ae2c5fc-f659-4bc3-8fe0-18b07ab5e57a) - env: - POSTMAN_COLLECTION: https://www.getpostman.com/collections/f5a58cf2d476785aed5f - run: docker-compose --profile test -f docker-compose.ci.yml up --exit-code-from newman newman - - - name: Run PIMS Lab Workflow Tests (https://www.getpostman.com/collections/2ee8ebff39c078bac256) - env: - POSTMAN_COLLECTION: https://www.getpostman.com/collections/2ee8ebff39c078bac256 + POSTMAN_COLLECTION: https://www.getpostman.com/collections/ab7cb9127e90777d39f4 run: docker-compose --profile test -f docker-compose.ci.yml up --exit-code-from newman newman - name: Run MLLP Tests diff --git a/configs/opencr/config_port.json b/configs/opencr/config_port.json index 69d2841..f979bf3 100644 --- a/configs/opencr/config_port.json +++ b/configs/opencr/config_port.json @@ -66,7 +66,7 @@ } }, "sync": { - "lastFHIR2ESSync": "2021-12-03T16:33:53" + "lastFHIR2ESSync": "2022-02-11T20:16:29" }, "__comments": { "matching.tool": "this tells if the app should use mediator algorithms or elasticsearch algorithms for matching, two options mediator and elasticsearch" diff --git a/configs/openhim/test-openhim-config.json b/configs/openhim/test-openhim-config.json index 493819d..9891d6b 100755 --- a/configs/openhim/test-openhim-config.json +++ b/configs/openhim/test-openhim-config.json @@ -99,7 +99,7 @@ "test" ], "whitelist": [], - "authType": "private", + "authType": "public", "matchContentTypes": [], "properties": [], "txViewAcl": [], @@ -134,10 +134,6 @@ "priority": 1, "alerts": [], "rewriteUrlsConfig": [], - "updatedBy": { - "id": "6112c011b572800013c71ec0", - "name": "Super User" - }, "matchContentJson": null, "matchContentRegex": null, "matchContentValue": null, @@ -157,7 +153,7 @@ "test" ], "whitelist": [], - "authType": "private", + "authType": "public", "matchContentTypes": [], "properties": [], "txViewAcl": [], @@ -191,18 +187,7 @@ ], "alerts": [], "rewriteUrlsConfig": [], - "priority": 2, - "updatedBy": { - "id": "6112c011b572800013c71ec0", - "name": "Super User" - }, - "matchContentJson": null, - "matchContentRegex": null, - "matchContentValue": null, - "matchContentXpath": null, - "pollingSchedule": null, - "tcpHost": null, - "tcpPort": null + "priority": 2 }, { "methods": [ @@ -227,10 +212,6 @@ "addAutoRewriteRules": true, "autoRetryEnabled": false, "autoRetryPeriodMinutes": 60, - "updatedBy": { - "id": "6112c011b572800013c71ec0", - "name": "Super User" - }, "requestBody": true, "responseBody": true, "description": "Get or Update the Lab Workflow Bundles in the SHR", @@ -431,473 +412,5 @@ } } ], - "Mediators": [ - { - "urn": "urn:mediator:shared-health-record", - "version": "0.1.1", - "name": "Shared Health Record", - "description": "Shared Health Record", - "config": { - "fhirServer": { - "username": "", - "password": "", - "baseURL": "http://shr-fhir:8080/fhir" - }, - "clientRegistry": { - "username": "", - "password": "", - "url": "http://openhim-core:5001/CR/fhir" - } - }, - "defaultChannelConfig": [ - { - "methods": [ - "GET", - "POST", - "PUT", - "PATCH" - ], - "type": "http", - "allow": [], - "whitelist": [], - "authType": "private", - "matchContentTypes": [], - "properties": [], - "txViewAcl": [], - "txViewFullAcl": [], - "txRerunAcl": [], - "status": "enabled", - "rewriteUrls": false, - "addAutoRewriteRules": true, - "autoRetryEnabled": false, - "autoRetryPeriodMinutes": 60, - "requestBody": true, - "responseBody": true, - "name": "SHR - FHIR Passthrough", - "description": "Get or Post a new FHIR Resource to the SHR", - "urlPattern": "^/SHR/fhir.*$", - "routes": [ - { - "type": "http", - "status": "enabled", - "forwardAuthHeader": false, - "name": "SHR - Get/Create/Update Resource", - "secured": false, - "host": "shr", - "port": 3000, - "path": "", - "pathTransform": "s/SHR\\/fhir/fhir/g", - "primary": true, - "username": "", - "password": "" - } - ], - "priority": 1, - "alerts": [], - "rewriteUrlsConfig": [] - }, - { - "methods": [ - "GET", - "POST", - "PUT" - ], - "type": "http", - "allow": [], - "whitelist": [], - "authType": "private", - "matchContentTypes": [], - "properties": [], - "txViewAcl": [], - "txViewFullAcl": [], - "txRerunAcl": [], - "status": "enabled", - "rewriteUrls": false, - "addAutoRewriteRules": true, - "autoRetryEnabled": false, - "autoRetryPeriodMinutes": 60, - "name": "SHR - Get/Update IPS", - "requestBody": true, - "responseBody": true, - "description": "Get or Update the International Patient Summary Bundle from the SHR", - "urlPattern": "^/SHR/fhir/ips.*$", - "routes": [ - { - "type": "http", - "status": "enabled", - "forwardAuthHeader": false, - "name": "SHR - Get IPS", - "secured": false, - "host": "shr", - "port": 3000, - "path": "", - "pathTransform": "s/SHR\\/fhir\\/ips/ips/g", - "primary": true, - "username": "", - "password": "" - } - ], - "alerts": [], - "rewriteUrlsConfig": [], - "priority": 2 - }, - { - "methods": [ - "GET", - "POST", - "DELETE", - "PUT" - ], - "type": "http", - "allow": [], - "whitelist": [], - "authType": "private", - "matchContentTypes": [], - "properties": [], - "txViewAcl": [], - "txViewFullAcl": [], - "txRerunAcl": [], - "status": "enabled", - "rewriteUrls": false, - "addAutoRewriteRules": true, - "autoRetryEnabled": false, - "autoRetryPeriodMinutes": 60, - "requestBody": true, - "responseBody": true, - "description": "Get or Update the Lab Workflow Bundles in the SHR", - "urlPattern": "^/SHR/lab.*$", - "routes": [ - { - "type": "http", - "status": "enabled", - "forwardAuthHeader": false, - "name": "SHR - Get Lab Bundle", - "secured": false, - "host": "shr", - "port": 3000, - "path": "", - "pathTransform": "s/SHR\\/lab/lab/g", - "primary": true, - "username": "", - "password": "" - } - ], - "alerts": [], - "rewriteUrlsConfig": [], - "priority": 3, - "name": "SHR Lab" - } - ], - "endpoints": [ - { - "type": "http", - "status": "enabled", - "forwardAuthHeader": false, - "name": "SHR Endpoint", - "host": "shr", - "path": "/", - "port": 3000, - "primary": true - } - ], - "configDefs": [], - "_uptime": 556.355190456, - "_lastHeartbeat": "2021-08-10T18:33:17.282Z" - }, - { - "urn": "urn:mediator:hl7v2tofhir_translator", - "version": "2.3.4", - "name": "HL7v2 to FHIR Translator", - "description": "HL7v2 to FHIR Translator", - "defaultChannelConfig": [ - { - "methods": [ - "GET", - "POST", - "PUT", - "PATCH" - ], - "type": "http", - "allow": [], - "whitelist": [], - "authType": "private", - "matchContentTypes": [], - "properties": [], - "txViewAcl": [], - "txViewFullAcl": [], - "txRerunAcl": [], - "status": "enabled", - "rewriteUrls": false, - "addAutoRewriteRules": true, - "autoRetryEnabled": false, - "autoRetryPeriodMinutes": 60, - "requestBody": true, - "responseBody": true, - "name": "HL7v2 Translator API Passthrough", - "description": "HL7v2 Translator API Passthrough", - "urlPattern": "^/72f/.*$", - "routes": [ - { - "type": "http", - "status": "enabled", - "forwardAuthHeader": false, - "name": "Send to Translator ", - "secured": false, - "host": "fhir-converter", - "port": 3000, - "path": "", - "pathTransform": "s/72f/api/g", - "primary": true, - "username": "", - "password": "" - } - ], - "alerts": [], - "rewriteUrlsConfig": [], - "priority": 4 - }, - { - "methods": [ - "POST" - ], - "type": "http", - "allow": [], - "whitelist": [], - "authType": "private", - "matchContentTypes": [], - "properties": [], - "txViewAcl": [], - "txViewFullAcl": [], - "txRerunAcl": [], - "status": "enabled", - "rewriteUrls": false, - "addAutoRewriteRules": true, - "autoRetryEnabled": false, - "autoRetryPeriodMinutes": 60, - "requestBody": true, - "responseBody": true, - "name": "FHIR --> HL7v2 API", - "description": "FHIR to HL7v2 Translation", - "urlPattern": "^/f27/.*$", - "routes": [ - { - "type": "http", - "status": "enabled", - "forwardAuthHeader": false, - "name": "Send to Translator ", - "secured": false, - "host": "fhir-converter", - "port": 2019, - "path": "", - "pathTransform": "s/f27/api/convert/fhir/g", - "primary": true, - "username": "", - "password": "" - } - ], - "priority": 5, - "alerts": [], - "rewriteUrlsConfig": [] - } - ], - "endpoints": [ - { - "type": "http", - "status": "enabled", - "forwardAuthHeader": false, - "name": "HL7v2 to FHIR Translator", - "host": "fhir-converter", - "port": 2019, - "primary": true, - "path": "/" - } - ], - "configDefs": [], - "_uptime": 422.077827879, - "_lastHeartbeat": "2021-08-10T18:33:17.301Z" - }, - { - "urn": "urn:mediator:bw_clientregistry", - "version": "0.1.1", - "name": "Client Registry", - "description": "Open Client Registry", - "config": { - "fhirServer": { - "username": "hapi", - "password": "hapi", - "baseURL": "http://opencr-fhir:8080/fhir" - }, - "elastic": { - "server": "http://es:9200", - "username": "", - "password": "", - "max_compilations_rate": "10000/1m", - "index": "patients" - }, - "matching": { - "tool": "elasticsearch" - } - }, - "configDefs": [ - { - "values": [], - "template": [ - { - "type": "string", - "description": "The base URL (e.g. http://localhost:8080/hapi/fhir)", - "displayName": "Base URL", - "param": "baseURL" - }, - { - "type": "string", - "description": "Username required to access FHIR server", - "displayName": "Username", - "param": "username" - }, - { - "type": "password", - "description": "Password required to access FHIR server", - "displayName": "Password", - "param": "password" - } - ], - "param": "fhirServer", - "displayName": "FHIR Server", - "description": "FHIR Server Configuration Details", - "type": "struct" - }, - { - "values": [], - "template": [ - { - "type": "string", - "description": "The base URL (e.g. http://localhost:9200)", - "displayName": "Base URL", - "param": "server" - }, - { - "type": "string", - "description": "Username required to access elasticsearch server", - "displayName": "Username", - "param": "username" - }, - { - "type": "password", - "description": "Password required to access elasticsearch server", - "displayName": "Password", - "param": "password" - }, - { - "type": "string", - "description": "Number of requests to compile per minute", - "displayName": "Maximum Compilations Rate", - "param": "max_compilations_rate" - }, - { - "type": "string", - "description": "index to use for data storage", - "displayName": "Index Name", - "param": "index" - } - ], - "param": "elastic", - "displayName": "Elasticsearch Server", - "description": "Elasticsearch Server Configuration Details", - "type": "struct" - }, - { - "values": [], - "template": [ - { - "type": "option", - "values": [ - "mediator", - "elasticsearch" - ], - "description": "Tool to Use for Matching", - "displayName": "Tool to Use for Matching", - "param": "tool" - } - ], - "param": "matching", - "displayName": "FHIR Server", - "description": "FHIR Server Configuration Details", - "type": "struct" - } - ], - "defaultChannelConfig": [ - { - "methods": [ - "GET", - "POST", - "PUT", - "DELETE" - ], - "type": "http", - "allow": [], - "whitelist": [], - "authType": "private", - "matchContentTypes": [], - "properties": [], - "txViewAcl": [], - "txViewFullAcl": [], - "txRerunAcl": [], - "status": "enabled", - "rewriteUrls": false, - "addAutoRewriteRules": true, - "autoRetryEnabled": false, - "autoRetryPeriodMinutes": 60, - "requestBody": true, - "responseBody": true, - "name": "Add or Get Resource Data From/To openCR", - "description": "Add or Get Resource Data From/To openCR", - "urlPattern": "/CR/fhir", - "matchContentRegex": null, - "matchContentXpath": null, - "matchContentValue": null, - "matchContentJson": null, - "pollingSchedule": null, - "tcpHost": null, - "tcpPort": null, - "rewriteUrlsConfig": [], - "alerts": [], - "routes": [ - { - "type": "http", - "status": "enabled", - "forwardAuthHeader": false, - "name": "Add/Get Resources", - "secured": true, - "host": "opencr", - "port": 3000, - "path": "", - "pathTransform": "s/CR/fhir/fhir/g", - "primary": true, - "username": "", - "password": "" - } - ], - "updatedBy": { - "id": "5d5d94607329d74724442f67", - "name": "Super User" - } - } - ], - "endpoints": [ - { - "type": "http", - "status": "enabled", - "forwardAuthHeader": false, - "name": "Activate Client Registry", - "host": "opencr", - "path": "/", - "port": 3000, - "primary": true - } - ], - "_uptime": 663.085615467, - "_lastHeartbeat": "2021-08-10T18:33:13.731Z" - } - ], "ContactGroups": [] } \ No newline at end of file diff --git a/configs/shr/config_ci.json b/configs/shr/config_ci.json index b4796a3..8606281 100644 --- a/configs/shr/config_ci.json +++ b/configs/shr/config_ci.json @@ -3,6 +3,10 @@ "port": 3000, "mllpPort": 3001 }, + "mllp": { + "targetIp": "shr", + "targetPort": 3001 + }, "mediator": { "api": { "username": "root@openhim.org", @@ -16,7 +20,7 @@ "mpiURL": "http://openhim-core:5001/CR/fhir", "baseURL": "http://shr-fhir:8080/fhir" }, - "fhirConverterUrl": "https://openhim-core:5000/72f", + "fhirConverterUrl": "http://openhim-core:5001/72f", "taskRunner": { "brokers" : ["kafka:9092"] } diff --git a/configs/shr/config_ports.json b/configs/shr/config_ports.json index 98f1c2c..c01ea61 100644 --- a/configs/shr/config_ports.json +++ b/configs/shr/config_ports.json @@ -3,6 +3,10 @@ "port": 3000, "mllpPort": 3001 }, + "mllp": { + "targetIp": "shr", + "targetPort": 3001 + }, "mediator": { "api": { "username": "root@openhim.org", @@ -18,7 +22,7 @@ }, "fhirServer": { "mpiURL": "https://openhim-core:5000/CR/fhir", - "baseURL": "https://shr-fhir:8080/fhir" + "baseURL": "http://shr-fhir:8080/fhir" }, "fhirConverterUrl": "https://openhim-core:5000/72f", "taskRunner": { diff --git a/dist/build_package.sh b/dist/build_package.sh index 47d6f38..a108757 100755 --- a/dist/build_package.sh +++ b/dist/build_package.sh @@ -13,8 +13,8 @@ docker save --output ./dist/package/docker/es.tar intrahealth/elasticsearch:late docker save --output ./dist/package/docker/mongo.tar mongo:3.4 docker save --output ./dist/package/docker/hapi.tar hapiproject/hapi:latest -docker save --output ./dist/package/docker/shared-health-record.tar ghcr.io/i-tech-uw/shared-health-record:v0.4.3 -docker save --output ./dist/package/docker/openhim-mediator-fhir-converter.tar ghcr.io/b-techbw/openhim-mediator-fhir-converter:latest +docker save --output ./dist/package/docker/shared-health-record.tar ghcr.io/i-tech-uw/shared-health-record:v0.4.4 +docker save --output ./dist/package/docker/openhim-mediator-fhir-converter.tar ghcr.io/b-techbw/openhim-mediator-fhir-converter:v3.1.4 docker save --output ./dist/package/docker/opencr.tar intrahealth/opencr:latest docker save --output ./dist/package/docker/newman.tar postman/newman:latest diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml index b7527fc..22eae78 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.yml @@ -77,7 +77,7 @@ services: profiles: ["mediators"] container_name: shr hostname: shr - image: ghcr.io/i-tech-uw/shared-health-record:v0.4.3 + image: ghcr.io/i-tech-uw/shared-health-record:${SHR_VERSION} restart: unless-stopped environment: - NODE_ENV=docker @@ -146,7 +146,7 @@ services: container_name: fhir-converter hostname: fhir-converter restart: unless-stopped - image: ghcr.io/b-techbw/openhim-mediator-fhir-converter:v3.0.1 + image: ghcr.io/b-techbw/openhim-mediator-fhir-converter:${FHIR_CONVERTER_VERSION} volumes: - ./configs/fhir-converter/config_ci.json:/app/config.json networks: @@ -180,6 +180,7 @@ services: - zookeeper networks: - hie + entrypoint: sh -c 'sleep 30 && /opt/bitnami/scripts/kafka/entrypoint.sh /opt/bitnami/scripts/kafka/run.sh' # prevent zookeeper conflict error # Newman Tests newman: diff --git a/docker-compose.local.yml b/docker-compose.domain.yml similarity index 75% rename from docker-compose.local.yml rename to docker-compose.domain.yml index 18af6be..2c5868b 100644 --- a/docker-compose.local.yml +++ b/docker-compose.domain.yml @@ -1,13 +1,13 @@ -version: "2.4" +version: '2.4' ## Port Assignments: ## See .env file -## Container debugging: -# 1. append the following lines to desired container +## Container debugging: +# 1. append the following lines to desired container # 2. boot up the container using `docker-compose up -d` # 3 run `docker exec -it bash` to start interactive shell -# +# # tty: true # stdin_open: true # entrypoint: bash @@ -16,25 +16,20 @@ services: ### # nginx reverse proxy # TODO: set up to use non-root user. See https://www.rockyourcode.com/run-docker-nginx-as-non-root-user/ - # TODO: Run letsencrypt as docker container: https://hub.docker.com/r/certbot/certbot/ ### nginx: + profiles: ["core"] image: nginx:latest container_name: nginx hostname: nginx restart: unless-stopped ports: - - 80:80 - - 443:443 - - 8080:8080 - - 8090:8090 - - 5000:5000 - - 5001:5001 - - 2575:2575 + - "80:80" + - "443:443" volumes: - - ./configs/nginx/nginx.local.conf:/etc/nginx/nginx.conf + - certs:/etc/letsencrypt + - ./configs/nginx/nginx.conf:/etc/nginx/nginx.conf - nginx-data:/var/www - - ./configs/nginx/certs:/etc/certs networks: - hie logging: @@ -42,10 +37,25 @@ services: max-size: "10k" max-file: "3" + certbot: + profiles: ["support"] + image: certbot/dns-route53 + container_name: certbot + entrypoint: "certbot certonly -n --agree-tos --email pmanko@uw.edu -d 'moh.org.bw' -d '*.moh.org.bw' --dns-route53 --preferred-challenges=dns" + environment: + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + volumes: + - certs:/etc/letsencrypt + - letsencrypt:/var/lib/letsencrypt + networks: + - hie + ### # OpenCR ### opencr: + profiles: ["mediator"] container_name: opencr hostname: opencr image: intrahealth/opencr:latest @@ -60,6 +70,7 @@ services: - ./configs/opencr/mediator_port.json:/src/server/config/mediator.json opencr-fhir: + profiles: ["core"] image: hapiproject/hapi:latest container_name: opencr-fhir hostname: opencr-fhir @@ -75,6 +86,7 @@ services: - cr-data:/data/hapi opencr-es: + profiles: ["core"] container_name: es image: intrahealth/elasticsearch:latest restart: unless-stopped @@ -96,19 +108,21 @@ services: # SHR ### shr: + profiles: ["mediator"] container_name: shr hostname: shr - image: ghcr.io/i-tech-uw/shared-health-record:v0.4.3 + image: ghcr.io/i-tech-uw/shared-health-record:${SHR_VERSION} restart: unless-stopped environment: - NODE_ENV=docker networks: - hie volumes: - - ./configs/shr/config_ports.json:/app/config/config_docker.json - - ./configs/shr/mediator_ports.json:/app/config/mediator_docker.json + - ./configs/shr/config_docker_template.json:/app/config/config_docker.json + - ./configs/shr/mediator.json:/app/config/mediator_docker.json shr-fhir: + profiles: ["core"] image: hapiproject/hapi:latest container_name: shr-fhir hostname: shr-fhir @@ -127,6 +141,7 @@ services: # OpenHIM ### openhim-core: + profiles: ["core"] container_name: openhim-core hostname: openhim-core image: jembi/openhim-core:latest @@ -144,6 +159,7 @@ services: - hie openhim-console: + profiles: ["core"] container_name: openhim-console hostname: openhim-console image: jembi/openhim-console:latest @@ -159,6 +175,7 @@ services: - hie mongo-db: + profiles: ["core"] container_name: mongo-db image: mongo:3.4 volumes: @@ -168,26 +185,27 @@ services: - hie fhir-converter: + profiles: ["mediator"] container_name: fhir-converter hostname: fhir-converter restart: unless-stopped - image: ghcr.io/b-techbw/openhim-mediator-fhir-converter:latest + image: ghcr.io/b-techbw/openhim-mediator-fhir-converter:${FHIR_CONVERTER_VERSION} volumes: - ./configs/fhir-converter/config_port.json:/app/config.json - /app/src/service-templates networks: - hie - + # Kafka zookeeper: - image: "bitnami/zookeeper:latest" + image: 'bitnami/zookeeper:latest' hostname: zookeeper environment: - ALLOW_ANONYMOUS_LOGIN=yes networks: - - hie + - hie kafka: - image: "bitnami/kafka:latest" + image: 'bitnami/kafka:latest' hostname: kafka container_name: kafka environment: @@ -202,10 +220,12 @@ services: depends_on: - zookeeper networks: - - hie + - hie + entrypoint: sh -c 'sleep 30 && /opt/bitnami/scripts/kafka/entrypoint.sh /opt/bitnami/scripts/kafka/run.sh' # prevent zookeeper conflict error # Newman Tests newman: + profiles: ["test"] image: postman/newman volumes: - ./.postman:/.postman @@ -214,18 +234,9 @@ services: - hie mllp_tests: + profiles: ["test"] container_name: mllp_tests - image: ghcr.io/b-techbw/mllp-tester:main - networks: - - hie - volumes: - - ./test/mllp:/test - - openhim-config: - container_name: openhim-config - image: ghcr.io/i-tech-uw/openhim-config:v0.0.0 - volumes: - - ./configs/openhim/test-openhim-config.json:/app/test-openhim-config.json + image: ghcr.io/b-techbw/mllp-tester:latest networks: - hie @@ -242,6 +253,10 @@ volumes: driver: local nginx-data: driver: local + certs: + driver: local + letsencrypt: + driver: local kafka-data: driver: local networks: diff --git a/docker-compose.yml b/docker-compose.yml index 12ce44f..45b0879 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,13 @@ -version: '2.4' +version: "2.4" ## Port Assignments: ## See .env file -## Container debugging: -# 1. append the following lines to desired container +## Container debugging: +# 1. append the following lines to desired container # 2. boot up the container using `docker-compose up -d` # 3 run `docker exec -it bash` to start interactive shell -# +# # tty: true # stdin_open: true # entrypoint: bash @@ -16,20 +16,25 @@ services: ### # nginx reverse proxy # TODO: set up to use non-root user. See https://www.rockyourcode.com/run-docker-nginx-as-non-root-user/ + # TODO: Run letsencrypt as docker container: https://hub.docker.com/r/certbot/certbot/ ### nginx: - profiles: ["core"] image: nginx:latest container_name: nginx hostname: nginx restart: unless-stopped ports: - - "80:80" - - "443:443" + - 80:80 + - 443:443 + - 8080:8080 + - 8090:8090 + - 5000:5000 + - 5001:5001 + - 2575:2575 volumes: - - certs:/etc/letsencrypt - - ./configs/nginx/nginx.conf:/etc/nginx/nginx.conf + - ./configs/nginx/nginx.local.conf:/etc/nginx/nginx.conf - nginx-data:/var/www + - ./configs/nginx/certs:/etc/certs networks: - hie logging: @@ -37,25 +42,10 @@ services: max-size: "10k" max-file: "3" - certbot: - profiles: ["support"] - image: certbot/dns-route53 - container_name: certbot - entrypoint: "certbot certonly -n --agree-tos --email pmanko@uw.edu -d 'moh.org.bw' -d '*.moh.org.bw' --dns-route53 --preferred-challenges=dns" - environment: - - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - volumes: - - certs:/etc/letsencrypt - - letsencrypt:/var/lib/letsencrypt - networks: - - hie - ### # OpenCR ### opencr: - profiles: ["mediator"] container_name: opencr hostname: opencr image: intrahealth/opencr:latest @@ -70,7 +60,6 @@ services: - ./configs/opencr/mediator_port.json:/src/server/config/mediator.json opencr-fhir: - profiles: ["core"] image: hapiproject/hapi:latest container_name: opencr-fhir hostname: opencr-fhir @@ -86,7 +75,6 @@ services: - cr-data:/data/hapi opencr-es: - profiles: ["core"] container_name: es image: intrahealth/elasticsearch:latest restart: unless-stopped @@ -108,21 +96,19 @@ services: # SHR ### shr: - profiles: ["mediator"] container_name: shr hostname: shr - image: ghcr.io/i-tech-uw/shared-health-record:v0.4.3 + image: ghcr.io/i-tech-uw/shared-health-record:${SHR_VERSION} restart: unless-stopped environment: - NODE_ENV=docker networks: - hie volumes: - - ./configs/shr/config_docker_template.json:/app/config/config_docker.json - - ./configs/shr/mediator.json:/app/config/mediator_docker.json + - ./configs/shr/config_ports.json:/app/config/config_docker.json + - ./configs/shr/mediator_ports.json:/app/config/mediator_docker.json shr-fhir: - profiles: ["core"] image: hapiproject/hapi:latest container_name: shr-fhir hostname: shr-fhir @@ -141,7 +127,6 @@ services: # OpenHIM ### openhim-core: - profiles: ["core"] container_name: openhim-core hostname: openhim-core image: jembi/openhim-core:latest @@ -159,7 +144,6 @@ services: - hie openhim-console: - profiles: ["core"] container_name: openhim-console hostname: openhim-console image: jembi/openhim-console:latest @@ -175,7 +159,6 @@ services: - hie mongo-db: - profiles: ["core"] container_name: mongo-db image: mongo:3.4 volumes: @@ -185,27 +168,26 @@ services: - hie fhir-converter: - profiles: ["mediator"] container_name: fhir-converter hostname: fhir-converter restart: unless-stopped - image: ghcr.io/b-techbw/openhim-mediator-fhir-converter:latest + image: ghcr.io/b-techbw/openhim-mediator-fhir-converter:${FHIR_CONVERTER_VERSION} volumes: - ./configs/fhir-converter/config_port.json:/app/config.json - /app/src/service-templates networks: - hie - + # Kafka zookeeper: - image: 'bitnami/zookeeper:latest' + image: "bitnami/zookeeper:latest" hostname: zookeeper environment: - ALLOW_ANONYMOUS_LOGIN=yes networks: - - hie + - hie kafka: - image: 'bitnami/kafka:latest' + image: "bitnami/kafka:latest" hostname: kafka container_name: kafka environment: @@ -220,11 +202,11 @@ services: depends_on: - zookeeper networks: - - hie - + - hie + entrypoint: sh -c 'sleep 30 && /opt/bitnami/scripts/kafka/entrypoint.sh /opt/bitnami/scripts/kafka/run.sh' # prevent zookeeper conflict error + # Newman Tests newman: - profiles: ["test"] image: postman/newman volumes: - ./.postman:/.postman @@ -233,9 +215,18 @@ services: - hie mllp_tests: - profiles: ["test"] container_name: mllp_tests - image: ghcr.io/b-techbw/mllp-tester:latest + image: ghcr.io/b-techbw/mllp-tester:main + networks: + - hie + volumes: + - ./test/mllp:/test + + openhim-config: + container_name: openhim-config + image: ghcr.io/i-tech-uw/openhim-config:v0.0.0 + volumes: + - ./configs/openhim/test-openhim-config.json:/app/test-openhim-config.json networks: - hie @@ -252,10 +243,6 @@ volumes: driver: local nginx-data: driver: local - certs: - driver: local - letsencrypt: - driver: local kafka-data: driver: local networks: