Docker Compose project to run Bahmni.
Move to the location of your choice, eg, your home folder:
cd ~/
Then create the working directory and save the path:
export BAHMNI_DIR=$PWD/bahmni && \
mkdir $BAHMNI_DIR
export VERSION=2.9.0-SNAPSHOT && \
# Download the project && \
mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:get -DremoteRepositories=https://nexus.mekomsolutions.net/repository/maven-public -Dartifact=net.mekomsolutions:bahmni-docker-compose:$VERSION:zip -Dtransitive=false --legacy-local-repository && \
# Unzip the project in $BAHMNI_DIR/bahmni-docker-compose-$VERSION && \
mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:unpack -Dproject.basedir=$BAHMNI_DIR -Dartifact=net.mekomsolutions:bahmni-docker-compose:$VERSION:zip -DoutputDirectory=$BAHMNI_DIR/bahmni-docker-compose-$VERSION
The Docker images do not provide a default Bahmni distribution so you need to first fetch one.
Fetch the distribution of your choice:
Eg, Bahmni Distro Haiti:
export DISTRO_GROUP="haiti" && \
export DISTRO_VERSION="2.7.0" && \
# Download the distro && \
mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:get -DremoteRepositories=https://nexus.mekomsolutions.net/repository/maven-public -Dartifact=net.mekomsolutions:bahmni-distro-$DISTRO_GROUP:$DISTRO_VERSION:zip -Dtransitive=false --legacy-local-repository && \
# Unzip the distro in $BAHMNI_DIR/bahmni-distro-$DISTRO_GROUP-$DISTRO_VERSION && \
mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:unpack -Dproject.basedir=$BAHMNI_DIR -Dartifact=net.mekomsolutions:bahmni-distro-$DISTRO_GROUP:$DISTRO_VERSION:zip -DoutputDirectory=$BAHMNI_DIR/bahmni-distro-$DISTRO_GROUP-$DISTRO_VERSION
The Bahmni Docker project relies on environment variable to document where the Distro is to be found. As an example, you can export the following variables:
export DISTRO_PATH=$BAHMNI_DIR/bahmni-distro-$DISTRO_GROUP-$DISTRO_VERSION && \
export OPENMRS_CONFIG_PATH=$DISTRO_PATH/openmrs_config && \
export BAHMNI_CONFIG_PATH=$DISTRO_PATH/bahmni_config && \
export OPENMRS_MODULES_PATH=$DISTRO_PATH/openmrs_modules && \
export BAHMNI_APPS_PATH=$DISTRO_PATH/bahmni_emr/bahmniapps && \
export ODOO_CONFIG_PATH=$DISTRO_PATH/odoo_config && \
export ODOO_EXTRA_ADDONS=$DISTRO_PATH/odoo_addons && \
export EIP_CLIENT_ROUTES_PATH=$DISTRO_PATH/eip_config/routes && \
export EIP_CONFIG_PATH=$DISTRO_PATH/eip_config
The complete list of available variables can be found in .env.
cd $BAHMNI_DIR/bahmni-docker-compose-$VERSION && \
docker-compose -p $DISTRO_GROUP up
Important: This assumes that you run the docker
command as the same user and in the same window in which you exported your variables.
If Docker is run as sudo
, the variables won't have an effect. Make sure to either export them as root, or run docker
with sudo -E
option to preserve the user environment. See Docker on Linux Post-install steps
- Bahmni: http://localhost/
- OpenMRS: http://localhost/openmrs
Default credentials:
- username: superman
- password: Admin123
- Odoo: http://localhost:8069/
Default credentials:
- username: admin
- password: admin
- Metabase: http://localhost:9003/
Default credentials:
- username: [email protected]
- password: Metapass123
- OpenELIS: http://localhost/openelis
Default credentials:
- username: admin
- password: adminADMIN!
To enable TLS support, just export the variable:
export PROXY_TLS="-DenableTLS"
and restart the application.
Default certificates are self-signed and therefore unsecured.
Provide your own valid certificates as a bound volume mounted at /etc/tls/
.
To run a fresh system based on a production backup file (see here for more details) follow these steps:
- Unzip the backup file and rename PostgreSQL database files to .tar: Eg:
- OpenELIS : clinlims.tar
- Odoo : odoo.tar
- Move PostgreSQL database files to ./sqls/postgresql/restore folder
- For OpenMRS database please follow the steps here
- Unzip the filestore.zip file and set the variables in .env file as following:
Example for a K8s-made backup:
- Odoo:
ODOO_FILESTORE=<filestore-path>/odoo/filestore/odoo
- OpenMRS:
OPENMRS_LUCENE_PATH=<filestore-path>/openmrs/lucene
OPENMRS_ACTIVEMQ_PATH=<filestore-path>/openmrs/activemq-data
OPENMRS_CONFIG_CHECKSUMS_PATH=<filestore-path>/openmrs/configuration_checksums
BAHMNI_HOME_PATH=<filestore-path>/openmrs/bahmni
- Odoo:
Note: <filestore-path>
is the path of the folder where filestore.zip file was unzipped.
- Start PostgreSQL:
docker-compose [-p <project-name>] up -d postgresql
- Start the restore service
docker-compose [-p <project-name>] -f postgres_restore.yml up
Now the restore is done, you can turn off postgresql by
docker-compose [-p <project-name>] stop postgresql
or simply start Bahmni as described here
To start OpenMRS with your own database, just drop your data file (.sql
or .sql.gz
) in the ./sqls/mysql/ folder and recreate your volumes (docker-compose -v down
).
To get the backup of services:
export BACKUP_PATH=<path/to/backup>
# Run the backup
export BACKUP_FOLDER=`date +%F-%R` && docker-compose [-p <project-name>] -f backup.docker-compose.yml up
export AWS_ACCESS_KEY_ID=aws_secret_key_id && \
export AWS_SECRET_ACCESS_KEY=aws_access_key && \
export S3_PATH=s3://exampe-backup/ && \
export CRON_SCHEDULE=*/5 * * * * && \
export UPLOAD_TARGET_DIR=<backup directory> && \
export DOWNLOAD_TARGET_DIR=<directory to download to>
docker-compose -f s3-sync-docker-compose.yml up upload-backup -d
docker-compose -f s3-sync-docker-compose.yml up download-backup -d
If you are developing, you may not want to run the complete Bahmni suite. You can disable services by adding docker-compose.override.yml file at the project root with the following contents:
./docker-compose.override.yml
#
# Example file to disable docker-compose.yml services.
#
version: "3.7"
services:
odoo:
profiles:
- "disabled"
postgresql:
profiles:
- "disabled"
You can also of course comment the services directly in the docker-compose.yml file.
Bahmni Docker project can be used to setup a dev environment for Bahmni. This is especially easy when working on Bahmni Apps.
This can be done by using watch rsync ...
command to see your changes on the running server.
- Clone and build Bahmni Apps locally:
cd ~/repos
git clone https://github.com/Bahmni/openmrs-module-bahmniapps.git
cd openmrs-module-bahmniapps/ui
Change JS and HTML files as you like.
- Run the
watch rsync
command to override the server files: (usingwatch
makes it run every 2 seconds)
watch rsync -av ~/repos/openmrs-module-bahmniapps/ui/ /tmp/bahmni-distro-haiti/bahmni_emr/bahmniapps/
The Java apps (OpenMRS, Bahmni Reports, Odoo Connect...) can be remote debugged very simply by setting a the DEBUG: "true"
environment variable to the service.
Don't forget to open the port 8000
on the service as well:
Eg:
...
environment:
DEBUG: "true"
...
ports:
- 8000:8000
...
In order to provide additional properties files to openmrs, you can drop your file in the ./properties/openmrs/ folder.
Files will be made available in the application directory after a convenient environment variable substitution is applied.
Special case of runtime properties:
In order to provide additional runtime properties to OpenMRS, you can drop a file that is named such as <name>-runtime.properties
.
It will be handled differently than the other properties files to be merged to the existing openmrs-runtime.properties
For instance:
Create a file named initializer-runtime.properties
in properties/openmrs/, with following contents:
initializer.exclude.locations=*void_h1*
This will be added to the openmrs-runtime.properties file.
The complete list of available variables can be found in .env.
- Docker
- Docker Compose
- Maven
- Supported components:
- OpenMRS
- Bahmni Apps
- Bahmni Config
- Bahmni Mart
- Metabase
- Odoo 14 (Odoo 10 supported on branch 1.x using Odoo Connect)
- OpenELIS