Dhis2 instances using portainer

Hi, has anyone try to manage dhis2 instances using portainer? Im looking for any example of it but I didnt get any results. The thing is I want to create a new dhis2 web instance as a new container in portainer. Please help.

Hi @aitor_garrido,

Thank you for posting to the community! (: May I ask you why specifically portainer? Maybe if you describe a bit more about the use case, other community members will be able to suggest based on their experiences and knowledge. :+1:

Thanks!

Thank you for your response! We are using portainer as a graphic interface in which we can manage diferents instances of dhis2, one for each project we have. Basically we want to have diferents docker containers , with diferent dhis2 instances, in diferents ports, in order to have everything in one web site and accesible for everyone of our department. Also, if we want to launch another dhis2 instance, it is easier for us to pull a new container using portainer , because everytime we launch a new project, we have to setup a new private server, install tomcat and dhis2. In this way we create a docker container which contains diferent dhis2 instances. All in the same place. Our problem is related in how is the best way to create that container. As we saw, we need 2 containers for every dhis2 instance: one for the database and the other for the web app. However, we dont know how to create it, or, at least, how to associate an empy database to the web app instance, using portainer. I don’t know if I made this clear. Thank you!

Hi @aitor_garrido,

Everything you say make sense. Yes, you do need two containers and so on.

If you’re not using Kubernetes I’ll recommend you implement your stack using Docker Compose.

Additionally, you can find an example of launching DHIS2 using Docker Compose here which should be simple to tweak.

In regards to running on different ports, depending on your setup you can perhaps use Nginx as a proxy? Please see GitHub - nginx-proxy/nginx-proxy: Automated nginx proxy for Docker containers using docker-gen

I hope the above gets you going. Please let us know if it doesn’t!

Best regards,
Andreas

1 Like

Hi! I tried to do as the link of docker compose using stacks and yes, using a docker compose file to create the stack, it generates 2 containers, one for the database and the other for the web. I used this DHIS2 with Docker | DHIS2 Developer Portal . The problem was, once I created it and launched it, it had errors, maybe cause I am not setting up the dhis.conf file, but in portainer i cant access to it. Our solution was to create inside the server the container as the link I paste before, and manage it with portainer, cause in portainer we couldnt created it correctly.

Hi @aitor_garrido,

I’ll recommend that you start without Portainer since that’s an extra layer of complexity.

Can you post the errors you’re getting while using docker compose?

Best regards,
Andreas

@aitor_garrido,

The problem was, once I created it and launched it, it had errors, maybe cause I am not setting up the dhis.conf file

dhis.conf file is a requirement for starting up dhis2, so you have to set it up (attach it as volume). So that could be a reason why you can’t access the instance.

I second @Andreas’s suggestion to get a running instance first without portainer. Once you have it working, you can add an extra layer of complexity.

Gintare

1 Like

@aitor_garrido we provide a container image where dhis.conf is set with environment variables. A docker-compose.yml file is provided as well: GitHub - baosystems/docker-dhis2: DHIS2 on Tomcat

1 Like