...
- Checkout opensrp-server and compile opensrp war file i.e. OpenSRP Server Build step 6.
- Change MySQL and CouchDB database credentials in opensrp.properties file
- Change MySQL credentials in quartz.properties
- Change ActiveMQ configuration in activemq.properties if applicable
- Checkout opensrp docker builds and navigate to the root folder.
Create a webapps folder and copy the compiled war file to the new directory.
No Format mkdir webapps cp <opensrp-server>/opensrp-web/target/*.war webapps
Build the container
No Format docker build -t onaio/opensrp .
Run the container
No Format docker run -d --name='opensrp' -e MYSQL_ROOT_PASSWORD='mypassword' -e MYSQL_MOTECH_DATABASE='motechquartz' \ -e MYSQL_OPENMRS_USER='openmrs' -e MYSQL_OPENMRS_PASSWORD='openmrs' -e MYSQL_OPENMRS_DATABASE='openmrs' \ -e COUCHDB_USER='rootuser' -e COUCHDB_PASSWORD='adminpass' \ -p 3306:3306 -p 5984:5984 -p 5985:5985 -p 8161:8161 -p 61616:61616 -p 9090:8080 onaio/opensrp
The docker run command given starts a container named 'opensrp' with the following variables and ports
Variables https://docs.docker.com/engine/reference/run/#/env-environment-variables
ENV Description MYSQL_ROOT_PASSWORD
password for mysql root user
MYSQL_MOTECH_DATABASE
motech database name
MYSQL_OPENMRS_USER
openmrs database user name
MYSQL_OPENMRS_PASSWORD
openmrs database password
MYSQL_OPENMRS_DATABASE
openmrs database name
COUCHDB_USER
couchdb root/system user name [Optional]
COUCHDB_PASSWORD
couchdb root/system password [Optional]
Ports https://docs.docker.com/engine/reference/run/#/expose-incoming-ports
Service Host Port Container Port mysql 3306 3306 couchdb 5984 5984 couchdb-lucene 5985 5985 activemq 8161 8161 activemq 61616 61616 tomcat7 9090 8080 NB: Host ports can be changed i.e. if mysql is already installed in port 3306, host port 3306 can be changed to 3307.
Check the logs
No Format docker logs -f opensrp
-f option follows log output.
No errors/exceptions should be displayed in the logs if the container has started successfully.
Copy opensrp war to the container's webapps folder
No Format docker cp webapps/opensrp.war opensrp:/opt/tomcat/webapps
Test the services
Service Link Credentials OpenSRP httphttp://localhost:9090/opensrp OpenMRS httphttp://localhost:9090/openmrs admin/Admin123 CouchDB httphttp://localhost:5984 rootuser/adminpass CouchDB Lucene httphttp://localhost:5984 ActiveMQ httphttp://localhost:8161 MySQL http://localhost:3306 root/mypassword
...