RedHatOfficial / openemr-kube

OpenShift/Kube deployment info for OpenEMR (https://www.open-emr.org/)
11 stars 13 forks source link

Make Container Image OpenShift-friendly #14

Open adambkaplan opened 4 years ago

adambkaplan commented 4 years ago

Some changes that will make this easier to use on OpenShift

  1. No git clone in the "builder" - OpenShift can take care of that from upstream repo.
  2. Application runs as root
  3. Extra content can be added as separate Build inputs.
bostrt commented 4 years ago

Application runs as root

This particular item was addressed in https://github.com/RedHatOfficial/openemr-kube/pull/11 which included some other changes to make it run in OpenShift.

ryannix123 commented 4 years ago

@bostrt @adambkaplan I've added instructions for deploying to OpenShift here: https://github.com/ryannix123/openemr-kube-1/blob/nix_capstone/Instructions.md

I will eventually make a pull request to add OpenShift specific deployment instructions.

There is an error when deploying to the free-tier of OpenShfit.com, but I can deploy to OKD 3.11.

ryannix123 commented 4 years ago

@isimluk and @bostrt I hopped on the weekly OpenEMR Zoom call, and I think it's an issue related to the php.ini file. https://github.com/openemr/openemr-devops/blob/45d7e83c7ecdc6cf90ae51afdd61777b8b8660ab/docker/openemr/5.0.2/php.ini#L1371

I created a new PHP.ini file, and I would like to test it with the Dockerfile for this project, but I can't figure out how you all got it to run as a non-root user? (For deploying to OpenShift)

https://github.com/ryannix123/openemr-container-config/blob/master/php.ini

bostrt commented 4 years ago

Hey @ryannix123, afaik the steps in the README.md should be working though I haven't re-tested them in a few weeks.

You may need to build the docker image you are working with, push to a registry (docker.io, quay.io), and then modify the image line in the deployment to point to your custom image: https://github.com/RedHatOfficial/openemr-kube/blob/master/artifacts/openemr/openemr-deployment.yaml#L48

That's the sort of steps I went through to do some local testing of an image. If you need any more detail, let me know!

ryannix123 commented 4 years ago

@bostrt, thanks for the quick reply! The deployment works perfectly except for this one small issue with the session ID. The people at the OpenEMR project think it is possibly related to the php.ini setting, which is odd because this project's Dockerfile specifies their php.ini file, and their Docker image works.

You can check it out here: https://emr.apps.cloudapps.northwestern.edu/interface/login/login.php?site=default

However, before I build the docker image locally, I'm trying to figure out how the docker image is running without root since a different user isn't specified in Dockerfile associated with the project.

bostrt commented 4 years ago

Hey @ryannix123, OpenShift will assign a random UID unless you specify otherwise (which requires special privleged). I believe that's the behaviour you are seeing.

Note that some files are chown/chmod in the Dockerfile we built to allow the random UID permission.

I hope this helps and let me know!

ryannix123 commented 4 years ago

@bostrt Thanks, I'll give it a whirl today to see if I can get this session bug knocked out. The phpMyAdmin deployment is working, but I can tackle that later.