Environment Variables:
Variable Name | Description | |
---|---|---|
1 | OPENMRS_IMAGE_TAG | This value tells which image version to be used for Bahmni OpenMRS. List of tags can be found at bahmni/openmrs - Tags . |
2 | OPENMRS_DB_NAME | Database name for OpenMRS application |
3 | OPENMRS_DB_HOST | Host name of the MySQL Database server. |
4 | OPENMRS_DB_USERNAME | Username of the OpenMRS Database. OpenMRS container will create a database user with this credential. |
5 | OPENMRS_DB_PASSWORD | Password of the OpenMRS Database. OpenMRS container will create a database user with this credential. |
6 | OPENMRS_DB_CREATE_TABLES | Takes either true/false. Setting this to true, OpenMRS creates the tables necessary or running the application. Note: Set this to true only when you are running with an empty MySQL Database. |
7 | OPENMRS_DB_AUTO_UPDATE | Takes either true/false. When set to true, the migrations are run and schema is kept up to date. |
8 | OPENMRS_MODULE_WEB_ADMIN | Takes either true/false. Settings this to true allows you to manage OpenMRS Modules through the Web UI. It is recommended to set to false in production. |
9 | OPENMRS_DEBUG | Takes either true/false. Enables the debug mode of OpenMRS |
10 | OPENMRS_UPLOAD_FILES_PATH | This variable can be specified with a directory of the host machine where the uploaded files from OpenMRS needs to be stored. Defaults to |
11 | MYSQL_ROOT_PASSWORD | This is the root password for MySQL Database Server used by OpenMRS DB service. |
12 | OPENMRS_DB_IMAGE_NAME | This is used to set the type of database container to start up. You can use mysql:5.6 and set |
Setting up a fresh OpenMRS Instance
By default, the configuration of openmrs and openmrsdb services are set to load demo data from a backup file. If you want to start the installation with a fresh schema, set OPENMRS_DB_CREATE_TABLES
to true
and then set OPENMRS_DB_IMAGE_NAME
to mysql:5.6
. Now when start the schema will be created by liquibase migrations of OpenMRS and other OMODS loaded.
View OpenMRS Logs
Code Block |
---|
# To see OpenMRS logs (from the appropriate docker-compose sub-folder)
docker-compose logs openmrs -f
# Another way
docker logs <openmrs-container-id> -f
# To get container ID of all containers
docker ps |
Debugging OpenMRS Application
Since OpenMRS is running on Tomcat, remote debugging can be enabled and can be connected with IDE supporting remote debugging.(Eclipse, Intellij IDEA etc.)
Enable debugging by uncommenting & setting
OMRS_DEV_DEBUG_PORT
to some port (e.g 8000) in the .env and docker-compose filesNow remote debugging for OpenMRS is exposed on port
OMRS_DEV_DEBUG_PORT
in your local machine.Now you can follow the IDE configuration to setup remote debugging using host as
localhost
and port as the value ofOMRS_DEV_DEBUG_PORT
.For example in Intellij IDEA navigate to Run -> Edit Configurations. In the dialog box click on
+
icon to create a new config and selectRemote JVM Debug
. Fill in the host,port and name and click Apply. Now you can use the debugger.
Note |
---|
Make sure to disable debugging if you are running in a Production Environment |
Apache Tomcat Environment Variables
To set CATALINA_HOME and JAVA_OPTS or other Environment variables used by the Tomcat startup scripts, set the value of these variables, here. The values of CATALINA_HOME and JAVA_OPTS are set as
Code Block |
---|
JAVA_OPTS="$OMRS_JAVA_SERVER_OPTS" CATALINA_OPTS="${OMRS_JAVA_MEMORY_OPTS} -DOPENMRS_INSTALLATION_SCRIPT=${OMRS_SERVER_PROPERTIES_FILE} -DOPENMRS_APPLICATION_DATA_DIRECTORY=${OMRS_DATA_DIR}/" |
Values of OMRS_SERVER_PROPERTIES_FILE
by default is set to /openmrs/openmrs-server.properties
and OMRS_DATA_DIR
set to /openmrs/data