Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add laboratory workflow package #2

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/docker/compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ elif [ "$1" == "destroy" ]; then

else
echo "Valid options are: init, up, down, or destroy"
fi
fi
Empty file added lab/README.md
Empty file.
4 changes: 4 additions & 0 deletions lab/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# EMR

This folder is a placeholder for experimenting with EMRs in Instant OpenHIE. The docker-compose file is copied from the instructions at: https://wiki.openmrs.org/display/docs/Installing+OpenMRS+on+Docker

40 changes: 40 additions & 0 deletions lab/docker/compose.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

composeFilePath=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )

if [ "$1" == "init" ]; then

docker create --name openelisglobal-database-helper -v openelis-db-data:/database/dbInit busybox
docker cp "$composeFilePath"/importer/volume/database/dbInit/. openelisglobal-database-helper:/database/dbInit/
docker rm openelisglobal-database-helper

docker create --name openelis-plugins-helper -v openelis-plugins-data:/plugins/ busybox
docker cp "$composeFilePath"/importer/volume/plugins/. openelis-plugins-helper:/plugins/
docker rm openelis-plugins-helper

docker create --name openelisglobal-webapp-helper -v openelis-server-data:/tomcat busybox
docker cp "$composeFilePath"/importer/volume/tomcat/oe_server.xml openelisglobal-webapp-helper:/tomcat/server.xml
docker rm openelisglobal-webapp-helper

docker create --name external-fhir-api-helper -v openelis-fhir-data:/tomcat busybox
docker cp "$composeFilePath"/importer/volume/tomcat/hapi_server.xml external-fhir-api-helper:/tomcat/server.xml
docker rm external-fhir-api-helper

# docker secret create datasource.password "$composeFilePath"/importer/volume/properties/datasource.password
# docker secret create common.properties "$composeFilePath"/importer/volume/properties/common.properties

docker-compose -f "$composeFilePath"/docker-compose.yml up

elif [ "$1" == "up" ]; then
docker-compose -p instant -f "$composeFilePath"/docker-compose.yml up -d

elif [ "$1" == "down" ]; then
docker-compose -p instant -f "$composeFilePath"/docker-compose.yml stop

elif [ "$1" == "destroy" ]; then
docker-compose -p instant -f "$composeFilePath"/docker-compose.yml down -v

else
echo "Valid options are: init, up, down, or destroy"
fi

119 changes: 119 additions & 0 deletions lab/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
version: '3.3'
services:
certs:
container_name: oe-certs
image: ghcr.io/i-tech-uw/certgen:main
restart: always
environment:
- KEYSTORE_PW="kspass"
- TRUSTSTORE_PW="tspass"
volumes:
- cert-volume:/etc/openelis-global

database:
container_name: openelisglobal-database
image: postgres:9.5
ports:
- "15432:5432"
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=clinlims
- POSTGRES_INITDB_ARGS="--auth-host=md5"
# env_file:
# - /home/moses/Desktop/U-WASH-PROJ/TICKETS/INSTANT-OPENHIE-PROJECT/labPackage/instant/lab/docker/importer/volume/database/database.env
volumes:
# preserves the database between containers
- db-data:/var/lib/postgresql/data
# files here will run on install
- openelis-db-data:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "clinlims", "-U", "clinlims" ]
timeout: 45s
interval: 10s
retries: 10

oe.openelis.org:
container_name: openelisglobal-webapp
image: ghcr.io/i-tech-uw/openelis-global-2:develop
depends_on:
- database
ports:
- "8095:8080"
- "8443:8443"
restart: always
networks:
default:
# ipv4_address: 127.0.0.1
# driver: bridge
# # ipam:
# # config:
# # - subnet: 172.20.1.0/24

restart: always
environment:
- TZ=Africa/Nairobi
# context.xml doesn't seem to be able to pick up environment variables directly, so we are passing them in as CATALINA_OPTS
- CATALINA_OPTS= -Ddatasource.url=jdbc:postgresql://database:5432/clinlims -Ddatasource.username=clinlims
volumes:
- cert-volume:/etc/openelis-global
- openelis-plugins-data:/var/lib/openelis-global/plugins
- openelis-server-data:/usr/local/tomcat/conf/
secrets:
- source: datasource.password
- source: common.properties

fhir.openelis.org:
container_name: external-fhir-api
image: hapiproject/hapi:v5.4.0
ports:
- "8081:8080"
- "8444:8443"
networks:
- default
restart: always
environment:
TZ: Africa/Nairobi

JAVA_OPTS: "-Djavax.net.ssl.trustStore=/etc/openelis-global/truststore
-Djavax.net.ssl.trustStorePassword=tspass
-Djavax.net.ssl.trustStoreType=pkcs12
-Djavax.net.ssl.keyStore=/etc/openelis-global/keystore
-Djavax.net.ssl.keyStorePassword=kspass
-Djavax.net.ssl.keyStoreType=pkcs12"

volumes:
- cert-volume:/etc/openelis-global
- openelis-fhir-data:/usr/local/tomcat/conf/
secrets:
- source: common.properties

secrets:
datasource.password:
# external: true
file: /home/moses/Desktop/U-WASH-PROJ/TICKETS/INSTANT-OPENHIE-PROJECT/labPackage/instant/lab/docker/importer/volume/properties/datasource.password
common.properties:
# external: true
file: /home/moses/Desktop/U-WASH-PROJ/TICKETS/INSTANT-OPENHIE-PROJECT/labPackage/instant/lab/docker/importer/volume/properties/common.properties

volumes:
db-data:
cert-volume:
openelis-db-data:
external: true
openelis-server-data:
external: true
openelis-fhir-data:
external: true
openelis-plugins-data:
external: true

networks:
default:
# driver: bridge
# ipam:
# config:
# - subnet: 127.0.0.1/10


4 changes: 4 additions & 0 deletions lab/docker/importer/volume/database/database.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POSTGRES_USER=postgres
POSTGRES_PASSWORD=admin
POSTGRES_DB=clinlims
POSTGRES_INITDB_ARGS="--auth-host=md5"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

CREATE USER clinlims PASSWORD 'clinlims';
CREATE USER admin SUPERUSER PASSWORD 'cPATaahXJlSj';
ALTER DATABASE clinlims OWNER TO clinlims;
Loading