Hi All,
The Bahmni team has been working on a way to set up a dev environment using Docker, such that you write code directly on your local machine, but the server components run in containers.
It’s especially valuable for Bahmni because (a) the full stack of OpenMRS + OpenELIS + Odoo is really tedious to set up, and (b) the front-end app is just html + js + css, so the compilation process to see code changes reflected on the server is minimal. But the approach can be helpful for plain OpenMRS too – here are some of my thoughts form looking at what they have done.
For precise details, see their code here https://github.com/Bhamni/bahmni-docker.
- Dockerizing the database
If OpenMRS development is the primary thing you’re doing, installing MySQL and having an OpenMRS DB isn’t really a big deal. But there are also reasons for us to avoid requiring it:
- a dev passing by might prefer not to install a DB just to test OpenMRS out (e.g. maybe they’ve already got PostgreSQL and CouchDB installed, and they can’t handle another)
- you might want to be experimenting with MySQL vs MariaDB, different versions, etc
- you might want an easy way to reset to a known database state
- you might want to be able to load up random DBs that implementations send you, but keep them contained, and disposable.
Anyway, I see that it requires a trivial Dockerfile to run MySQL and have it load a DB at startup.
- Dockerizing the server
I find Jetty very convenient, but running against Tomcat is perhaps slightly more realistic. Or some people just prefer it. One specific thing they do in Bahmni is that they map a local folder (specifically, the distro/target/distro filter from the distro maven project) to appear as the ~/.OpenMRS/modules folder, so that when tomcat starts up, the omods that you have in a specific local folder are loaded as modules.
- OpenMRS as a component of larger systems
Docker can make dev environment setup easier, but where I think it’s really going to be powerful is making it easier for people building systems that use OpenMRS as one component of a system (e.g. Bahmni, OpenSRP, OpenHIE, etc). If you can easily stand up a representative OpenMRS server in one or two containers, then it becomes much simpler to develop for a complex environment with multiple databases, event routers, etc.
@craigappl, @burke mentions you’re interested in this topic. Any interest in setting up some example Docker containers that produce an OpenMRS dev environment?