Why Run Docker OpenEMR Container in Cloud?

Now I have nothing against running OpenEMR in the cloud per say but, my problem arises as to the need to run as a single instance of OpenEMR in a docker container. Why use docker and not simply set up and run OpenEMR in a Ubuntu EC2 instance? I keep pondering this to find definitive advantages and get on board but it seems, i’m still buying the ticket. For me docker is great for development or running clusters of applications but for a single instance, the advantages elude me.

So, I hope to be educated and maybe this thread will prove useful to others having the same questions. Also, user experiences and did the cost for the service meet expectations.

The entire app is not contained in 1 docker, the docker-compose creates volumes for the database as well as web server. This adds an additional layer of security as access to the database is restricted to the private network that Docker creates. Plus it eases the installation and upgrade processes. My 2 cents

Hm, but docker is a container running in a container ie a virtual machine running a separate os(alpine) within a ubuntu running container. In the end docker is sharing resources with the AWS instance based on the resource allocation to the EC2 machine, right?
What makes this anymore secure then running a t2 w/o docker? Both have the same exposure to the internet and maybe the docker adds another level to accessing the OpenEMR image via terminal but still.
Still don’t get how docker makes upgrading easier in a production sites especially for those whom have custom code or modification one offs. For instance, maybe an explanation of how an upgrade process would work for a production site compared to a normal upgrade. What makes docker any easier than simple unzip?

Maybe @jesdynf would know a bit more about the specifics of AWS resource allocation :man_shrugging:

I think I understand how resources are allocated which really isn’t my concern here but more so, why bother with the worry of resource sharing with a docker container in the first place.

I mean, if you frontload the discussion with the “worry” of the Docker, yes, it’s not going anywhere. The Docker container represents a fully-configured OpenEMR instance in a known state we can troubleshoot. Everything’s exactly where I put it, and anyone familiar with the Dockerized image can support any install of the image, regardless of the conditions on the host.

There’s people this isn’t valuable for, and that’s fine.

wow, sounds nefarious. I started this thread to help define why and to whom this solution is a viable resource for production sites and what the implications are or could be.

Exactly and that’s one of the points i’m trying to get defined. What cases aren’t a good fit for this solution? Also, ramifications for upgrades/patches.

This makes good sense, thanks for that.

I don’t think Asher is trying to be nefarious. If you are a career sysadmin with expertise in PHP, MariaDB, and Apache then I would agree with Asher that’s you probably don’t need the Docker. But I imagine a lot do our user base doesn’t have that level of expertise. Having a turn key solution that you lowers th barrier to success for non-experts is a net positive. It does make troubleshooting a lot easier as well as we know the exact state of the machine,

I see it similar to how package managers are used. Do you NEED one? No. Does it simplify life by using one? Nearly every time. Or like compiled code. Do you need the executable? No, you can always download from source and manually compile using gcc (or whatever). Does having an executable make life easier? Yep.

I guess my position then becomes if you are a master sysadmin, eh, take it or leave it. If you are anybody else it’s probably a way easier solution, you don’t have to manage your PHP installs, your database installs, your web server installs, or configuration, etc, it just works.

@sjpadgett The best bet would be to run OpenEMR on a Docker/Kubernetes platform like OpenShift. Redhat OpenShift is probably the best way to run Docker containers, in my opinion. OpenShift.com has a free tier too. Check out https://www.youtube.com/watch?v=82VbMo77fWQ to see how easy it is to deploy a PHP/MySQL application. All of the Docker/Kubernetes stuff is completely abstracted so you can just deploy OpenEMR as easily as can be.

I think the question isn’t where to run Docker, but why

I understand he is asking why run it on Docker, and he makes some good points on why Docker isn’t necessarily better by itself. I run two Discourse sites, and not only do I have to maintain Discourse, but I have to maintain the VMs that run the Docker images. e.g., updating the Docker daemon, rebooting the VM to run the latest kernel AND running apt-get autoremove to clean out the old Ubuntu kernels. This is tedious, and it takes away from just running your application. So while the benefits to running your application in a Docker container are great for portability, configuration consistency, etc, the underlying infrastructure is somewhat burdensome. That is why OpenShift is great because @sjpadgett can fork the OpenEMR repo then deploy to OpenShift in a fairly quick manner without worrying about the underlying system maintenance. Putting together a “How to deploy OpenEMR on OpenShift” has been on my bucket list for a while. I’ll try to put together something soon.

It should be straight forward to take the docker compose yaml file and convert to a kubectl yaml file. Probably some services, mounts and network configuration work also needed. That way it can be run on any Kubernetes platform, AWS, Azure, GCP. I’ll be playing around with this over the next month or so. If I get something working I’ll post it.

Hi @nsteblay ,

That sounds great. Check out this thread with examples on Docker Swarm:

Looking forward to see what you come up with.

-brady

Thanks! Just started looking at OpenEMR on Github. PHP monolith. Should be straight forward.

Got it working! It is running great on my local single node Kubernetes cluster. I’m using WSL2 and Docker Desktop Kubernetes on Windows 10 fast ring. I’ll try it on my Mac using Docker Desktop’s Kubernetes later this week.

I am struggling a bit with local volumes for openemr sites and logs, but have mariadb local volume working correctly. Once I get it all working and documented I’ll upload YAML files.

1 Like