Versions Compared

Key

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

Video tutorial

Widget Connector
overlayyoutube
_templatecom/atlassian/confluence/extra/widgetconnector/templates/youtube.vm
width400px
urlhttps://www.youtube.com/watch?v=e0nhczKMHhw&feature=youtu.be
height300px

https://youtu.be/e0nhczKMHhw

Excerpt

This guide is valid for the installation of the full modular new openIMIS version together with the REST API component.

0. Prerequisite

To install the full modular openIMIS using Docker, you first need first to install Docker on your computer/server. Please visit https://docs.docker.com/get-docker/ website to download and install the version that matches your OS.

1. Download openIMIS Docker script

Clone the https://github.com/openimis/ openimis-dist_dkr on your machine into a new folder.

2. First startup

  • create a Create the .env file , providing the following variables:

Code Block
languagetext
# database parameters
DB_HOST=db
DB_PORT=1433
#DB_PORT=5432
DB_PASSWORD=IMISuserP@s
DB_USER=IMISuser
DB_NAME=IMIS
DB_ENGINE=mssql
#DB_ENGINE=django.db.backends.postgresql or sql_server.pyodbc
ACCEPT_EULA= <y if you accept MS EULA >

# urls
# url of openimis
NEW_OPENIMIS_HOST=demo.openimis.org
# http port for openimis
GATEWAY_PORT=80
# https port for openimis
GATEWAY_PORT_S=443

# github branches to use
# Database
DB_BRANCH=main
#Gate way
GW_BRANCH=main
# BE assembly
BE_BRANCH=main
#FE assembly
FE_BRANCH=main
# REST API
RESTAPI_BRANCH=main
# branch to get the code of the restapi

# build flavours
# rest API flavours (used by the mobile)
RESTAPI_BUILD_FLAVOR=Release

# docker-compose parameters
# docker compose project name
PROJECT_NAME=demo
# to use in case there is multiple openimis, the container have fixed IP address to avoid issue when a container is recreated: then it could change ip and the gateway woin't find it anymore (limitation of free nginx) 
IP_SUB=20

#one-liner json config for the BE (to override the openimis.json from the BE assembly)
#OPENIMIS_BE_CONF_JSON= 

#one-liner json config for the FE (to override the openimis.json from the FE assembly)
#OPENIMIS_FE_CONF_JSON= 
  • on the same level as openimis-dist_dkr directory, create a new conf directory (this is used for storing instance-specific configuration that will be reused if the docker containers are restarted)

  • if you use the demo docker 'db' service (not for production!):

    • The default database is the demo instance, to set-up an empty instance please setup the database manual from the script attached to each release sql-files.zip in the asset section

    • accept the Microsoft EULA for the MSSQL database container (set the value of ACCEPT_EULA to Y)

    • build and start the docker compose: docker-compose up -d

  • Updating the certificates of the frontend is required for production usage openimis-gateway_dkr/certs/.

  • Using the docker database is not advised for production.

  • This docker-compose doesn’t use REDIS and Celery. If multi-backend is required, please check the docker-compose in the openimis-dist_dkr directory or create a ticket.

  • To add a new backend user, you must edit the /conf/.htpasswd in the gateway container (scripts will be written later).

stop/start

  • from the .env.example and configure the environment variables according to the comments in the file. By default, PostgreSQL database is used.

  • then run those command in that order to make sure the coreMIS part is properly configured

    Code Block
    docker compose  up -d db
    #wait for the db to be initialised
    sleep 180
    #load the .env file in your shell to have the access to the env variables
    source .env
    source .env.lightning
    # create the lightning database
    docker compose  run -e  PGPASSWORD=${POSTGRES_PASSWORD} --rm db createdb -h db -U ${POSTGRES_USER}  ${POSTGRES_DB}
    set -e
    # init lighning
    docker compose  run --rm  web mix ecto.migrate
    docker compose  run --rm web mix run imisSetupScripts/imisSetup.exs
    #start all modules
    docker compose up -d
    #load opensearch dashbaord
    docker compose  run --rm -e MODE=DEV backend manage upload_opensearch_dashboards --host-domain https://demo.openimis.org --imis-password admin123

3. SSL certificate / https

there is a docker-compose that support let’s encrypt certificates

first export NEW_OPENIMIS_HOST ,

dry run

docker-compose run --rm --entrypoint " certbot certonly --webroot -w /var/www/certbot --staging --register-unsafely-without-email -d ${NEW_OPENIMIS_HOST} --rsa-key-size 2048 --agree-tos --force-renewal" certbot

actual setup

docker-compose run --rm --entrypoint " certbot certonly --webroot -w /var/www/certbot --register-unsafely-without-email -d ${NEW_OPENIMIS_HOST} --rsa-key-size 2048 --agree-tos --force-renewal" certbot

4. Actions

From within openimis-dist_dkr/windows directory:

  • To stop all docker containers: docker-compose stop 

  • To (re-)start all docker containers: docker-compose start

  • To pull new images or images update `docker-compose pull`