Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Checkout  opensrp-server and compile opensrp war file i.e. OpenSRP Server Build step 6.
    1. Change MySQL and CouchDB database credentials in opensrp.properties file
    2. Change MySQL credentials in quartz.properties
    3. Change ActiveMQ configuration in activemq.properties if applicable
  2. Checkout opensrp docker builds and navigate to the root folder.
  3. 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


  4. Build the container

    No Format
    docker build -t onaio/opensrp .


  5. 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

    ENVDescription
    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

    ServiceHost PortContainer Port
    mysql33063306
    couchdb59845984
    couchdb-lucene59855985
    activemq81618161
    activemq6161661616
    tomcat790908080

    NB: Host ports can be changed i.e. if mysql is already installed in port 3306, host port 3306 can be changed to 3307.


  6. 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.


  7. Copy opensrp war to the container's webapps folder

    No Format
    docker cp webapps/opensrp.war opensrp:/opt/tomcat/webapps


  8. Test the services

    ServiceLinkCredentials
    OpenSRP httphttp://localhost:9090/opensrp
    OpenMRS httphttp://localhost:9090/openmrsadmin/Admin123
    CouchDB httphttp://localhost:5984rootuser/adminpass
    CouchDB Lucene httphttp://localhost:5984
    ActiveMQ httphttp://localhost:8161
    MySQLhttp://localhost:3306root/mypassword


...