Docker installation (it runs but without data)

Hi all,

I am having issues installing a local instance of DHIS2 using the guide here https://developers.dhis2.org/2019/10/dhis2-and-docker/

I wanted to set it up using a sample database, so I used https://github.com/dhis2/dhis2-demo-db/tree/master/sierra-leone/2.32 which I renamed to init.sql after downloading and unzipping.

After following instructions and running docker-compose up using the image dhis2/core:2.33.4 the local session does start but there is no data:

Details of my configuration, running on MacOS

My file structure:

β”œβ”€β”€ config
β”‚   β”œβ”€β”€ init.sql
β”‚   └── dhis2_home
β”‚       └── dhis.conf
└── docker-compose.yml

This is my docker-compose.yml file:

version: '3'
services:
  db:
    image: mdillon/postgis:10-alpine
    command: postgres -c max_locks_per_transaction=100
    environment:
      POSTGRES_USER: dhis
      POSTGRES_DB: dhis2
      POSTGRES_PASSWORD: dhis
    volumes:
    - ./config/init.sql:/docker-entrypoint-initdb.d/init.sql
  web:
    image: dhis2/core:2.33.4
    volumes:
    - ./config/dhis2_home/dhis.conf:/DHIS2_home/dhis.conf
    environment:
    - WAIT_FOR_DB_CONTAINER=db:5432 -t 0
    ports:
    - "8080:8080"
    depends_on:
    - db

This is my dhis.conf file:

connection.dialect = org.hibernate.dialect.PostgreSQLDialect
connection.driver_class = org.postgresql.Driver

# "db" maps to service name defined in Docker Compose
# "dhis2" maps to POSTGRES_DB defined in Docker Compose
connection.url = jdbc:postgresql://db/dhis2

# maps to POSTGRES_USER environment variable in Docker Compose.
connection.username = dhis

# maps to POSTGRES_PASSWORD environment variable in Docker Compose.
connection.password = dhis

I also ran

docker run -v [path...]/dhis_2020/config/dhis2_home/dhis.conf dhis2/core:2.33.4

And I’ve tried this with other images (e.g. dhis2/core:2.33.0) and other demo databases.

So it seems to me that part of the data is there (e.g. emails, messages and the regions), but the actual values for programs or any other data capture system are not there. Any help would be greatly appreciated.

Thanks in advance!

As far as I see everything seems ok to me. I believe that the only thing you are missing is running the analytics so the data can be displayed.

The way DHIS2 works is precomputing all the analytics table according to your parameters (I think it is every night by default); but you can always force it by going to: Data Administration > Analytics Export. Be aware that this is a high demanding CPU task and that your docker db container will increase its size a lot!

1 Like

Hi!

Thank you for the quick reply. I wasn’t aware that the analytics had to be manually run. The last time I used DHIS2 was around v2.29 and I don’t recall having to do this. Is this a new behavior?

Do analytics also affect all other data? For instance, if I go to the Tracker Capture module* and try to create a report, none of the Org units have a program assigned to them

Upon further investigation, I see that there are programs, but none of them seemed to be assigned to an Org Unit. Does this mean there is no sample data for any program? Or if I run the Analytics Export would this create some data?

P.S. When you say that the DB will increase, are we talking about like 2GB or like 10GB?

Thanks again for the help!

Hi @jsolano91.

Some programs do have data and some others I think they don’t have. My recommendation would be checking what you are doing against the play servers ( https://play.dhis2.org/ ). As you have used the Sierra Leone database it is a clone and you should see the same.

Regarding the size, to be honest I am not sure, I would say several GBs but I haven’t run a full analytics on my local PC with an empty DB so cannot tell you.

1 Like

Thanks again @jaime.bosque. I will review against the play sever. Thanks for the suggestion and the info.