https://github.com/davidix/openmrs-docker
https://github.com/davidix/openmrs-docker
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/davidix/openmrs-docker
- Owner: davidix
- Created: 2022-05-27T11:08:33.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-27T11:13:02.000Z (about 4 years ago)
- Last Synced: 2025-03-20T18:17:33.823Z (over 1 year ago)
- Language: Shell
- Size: 1.04 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bahmni Docker Compose
Docker Compose project to run Bahmni.
## Quick Start
### Create your working directory:
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
```
### Download the Docker Compose project itself:
```
export VERSION=2.0.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
```
### Download the Bahmni distribution of your choice:
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="1.2.0-SNAPSHOT" && \
# 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_CONFIG_PATH=$DISTRO_PATH/eip_config && \
```
The complete list of available variables can be found in [.env](.env).
### Start Bahmni:
```
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](https://docs.docker.com/engine/install/linux-postinstall/)
### Access the servers:
- 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: admin@metabase.local
- password: Metapass123
- OpenELIS: http://localhost/openelis
Default credentials:
- username: admin
- password: adminADMIN!
## Advanced
### TLS support
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/`.
### Start from a backup file
To run a fresh system based on a production backup file (see [here](https://github.com/mekomsolutions/appliance-deployment/blob/main/README.md#backup-profile) for more details) follow these steps:
1. Unzip the backup file and rename PostgreSQL database files to **.tar**:
Eg:
- OpenELIS : **clinlims.tar**
- Odoo : **odoo.tar**
2. Move PostgreSQL database files to [./sqls/postgresql/restore](./sqls/postgresql/restore) folder
3. For OpenMRS database please folow the steps [here](#start-with-a-custom-mysql-dump)
4. Unzip the **filestore.zip** file and set the variables in **.env** file as following:
- Odoo:
- `ODOO_FILESTORE=/odoo`
- OpenMRS:
- `OPENMRS_LUCENE_PATH=/openmrs/lucene`
- `OPENMRS_ACTIVEMQ_PATH=/openmrs/activemq-data`
- `OPENMRS_CONFIG_CHECKSUMS_PATH=/openmrs/configuration_checksums`
- `BAHMNI_HOME_PATH=/openmrs/bahmni`
Note: `` is the path of the folder where **filestore.zip** file was unzipped.
5. Start PostgreSQL:
```
docker-compose [-p ] up -d postgresql
```
6. Start the restore service
```
docker-compose [-p ] -f postgres_restore.yml up
```
Now The restore is done, you can turn off postgresql by
```
docker-compose [-p ] stop postgresql
```
or simply start Bahmni as described [here](#start-bahmni)
### Start with a custom MySQL dump
To start OpenMRS with your own database, just drop your data file (`.sql` or `.sql.gz`) in the [./sqls/mysql/](./sqls/mysql/) folder and recreate your volumes (`docker-compose -v down`).
### Disable individual services
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:
entrypoint: ["echo", "[ERROR] Service is disabled in docker-compose.override.yml file"]
postgresql:
entrypoint: ["echo", "[ERROR] Service is disabled in docker-compose.override.yml file"]
```
You can also of course comment the services directly in the [docker-compose.yml](./docker-compose.yml) file.
### Develop in Bahmn Apps
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.
1. 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.
2. Run the `watch rsync` command to override the server files: (using `watch` makes it run every 2 seconds)
```
watch rsync -av ~/repos/openmrs-module-bahmniapps/ui/ /tmp/bahmni-distro-haiti/bahmni_emr/bahmniapps/
```
### Debug the Java apps
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
...
```
### Provide additional properties files to OpenMRS (including runtime properties)
In order to provide additional properties files to openmrs, you can drop your file in the [./properties/openmrs/](./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 `-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.
### All environment variables
The complete list of available variables can be found in [.env](.env).
## Dependencies
- Docker
- Docker Compose
- Maven
## Known limitations
- Supported components:
- OpenMRS
- Bahmni Apps
- Bahmni Config
- Bahmni Mart
- Metabase
- Odoo 14 (Odoo 10 supported on branch 1.x using Odoo Connect)
- OpenELIS