Best deployment strategy?

I curious about what the best method for deploying my OpenEMR code changes to AWS are. I have OpenEMR Standard set up on AWS and can pull and run the code locally, but don’t know the best way to deploy it.
Should I create a docker hub repo and pull from that in the EC2 instance? If so, how do I ensure that the environment variables and everything continue to work when I load the new Docker image? Should I copy the docker-compose.yml from what is being used on AWS and use that to build the Docker image?
Forgive my ignorance I’m new to Docker and still trying to figure it out! Thank you for you help!

hi @sprizzla, what about creating a zip file of your changes from your custom repo and pulling it into the docker and then extracting, kind of like the way the patches work

@sjpadgett shared this with me

Here is a neat git command I use often for quickly creating a patch zip for testing. Make your local repository up to date then, if you just want last commit use:
git archive -o /path/ HEAD $(git diff --name-only HEAD^)
or for a range of commits starting at head:
git archive -o /path/ HEAD $(git diff --name-only f65613a --diff-filter=ACMRTUXB)
Where f65613a represents the commit id plus one commit ie commit id not included.

Very handy.

Hi @stephenwaite, thanks for your response. I think that would work, but I was looking for a slightly more automated CI/CD approach. Maybe I can do something like that but pull the source code directly from Github into the Docker container? It still seems a little janky though- I’m kind of surprised this isn’t a more common issue with deployment. I feel like I’m missing something

you could have your own custom image in the docker-compose, would want to test it out on aws though with standard to make sure you’re not stepping on any toes

1 Like

Ya, that’s not a bad idea. I could just copy the image that’s being used on aws to use as a starting point for my custom image to try to ensure I don’t step on any toes.

I only just now noticed this, sorry.

AWS Standard is using the production dockers and docker-compose internally. All of the real complexity went into the CloudFormation template that launches AWS Standard and the preparation of the AMI that the template calls. Once Standard deploys, you could adjust the docker-compose.yml it creates to run your own derived container or load your code directly into the openemr container’s file system.

See /root/openemr-devops/packages/standard/docker-compose.yaml on your AWS Standard instance to get started, or openemr-devops/packages/standard/cfn at master · openemr/openemr-devops · GitHub for more information about what Standard’s doing behind the scenes.


That’s helpful, thanks!