OpenEMR Official Docker has been released!


(Brady Miller) #1

The OpenEMR Official Docker has just been released!

It supports modern, flexible, plug n play use of OpenEMR. See here:
http://www.open-emr.org/wiki/index.php/OpenEMR_Downloads#Docker

Thank you @toolbox for building this!

-brady


Planning for OpenEMR 5.0.1 release
(Sombi Willingtone) #2

woowooo wasome


(Brady Miller) #3

Hi,

For those of you wondering what the heck does this mean practically, gonna post several easy to follow examples, that will only require a web browser :smile:

UPDATE:
Check out the following post below for easy 1 click docker demos:

OpenEMR Official Docker has been released!

There is this very cool website at labs.play-with-docker.com (11/23/17 edit: you now need to login to use this site; you need to create an account at https://hub.docker.com/ and then use these credentials to log into labs.play-with-docker.com) where you can basically run and deploy dockers, which is good place to showcase dockers.

The first example is where you can click on the below long link and the above website will build and deploy the OpenEMR docker for you to try it out. It uses a docker-compose.yml file which is a higher level mechanism to deploy docker stacks and feeds it directly to labs.play-with-docker.com .
http://play-with-docker.com/?stack=https://gist.githubusercontent.com/bradymiller/988d5105e38ffd8f6fb3cf49bbfae9f0/raw/26fa8e7e3e1d7cd97d60185a96a033cff33df346/openemr-500-docker-example-docker-compose.yml

After a couple minutes, it will be complete. And if you then click on the ‘80’ button near the top, this will open a window into the already installed/configured OpenEMR.

If you are curious, click the *_node1 box at left below the Add New Isntance and it will open the shell to where the dockers you deployed are. Then type ‘docker ps -a’ at the command prompt, and you’ll see a docker for mysql and openemr, which are the containers. The images (which are where the containers come from) can be viewed with ‘docker images’.

until the next cool example(4 lines of code to bring in docker stack for mysql, phpmyadmin, and openemr),
-brady


(Brady Miller) #4

ok, next really cool thing to showcase the OpenEMR docker (for that 1 person whom clicked on the above link :slight_smile: )

This time, we will go straight to labs.play-with-docker.com ( (11/23/17 edit: you now need to login to use this site; you need to create an account at https://hub.docker.com/ and then use these credentials to log into labs.play-with-docker.com)). Then click ‘Add New Instance’ at the left and a new shell will open for you. Then copy/paste the four commands below:

docker network create mynet
docker run --detach --name mysql --env "MYSQL_ROOT_PASSWORD=root" --net mynet mysql --character-set-server=utf8
docker run --detach -p 81:80 --name phpmyadmin --env "PMA_HOST=mysql" --net mynet phpmyadmin/phpmyadmin
docker run --detach -p 80:80 --name openemr --env "MYSQL_HOST=mysql" --env "MYSQL_ROOT_PASS=root" --net mynet openemr/openemr

Let this go for about 4-5 minutes. After that time, click on the ‘81’ link at the top, and it will take you to phpmyadmin (root:root credentials) and you can see the openemr database there. And then click on the ‘80’ link at the top, and it will take you to the OpenEMR login screen(admin:pass credentials). So you can now play around with OpenEMR and the database anywhere you have access to a web browser!

To break down the above 4 commands above. First command sets up the network that the 3 dockers will use so they can communicate. Second command runs the mysql docker. Third command runs the phpmyadmin docker. Fourth command runs the openemr docker.

To see the 3 running dockers type ‘docker ps -a’.

You can also stop and start the dockers. For example, ‘docker stop openemr’ will stop the openemr docker while 'docker start openemr' will then restart the openemr docker.

ok, now you may get greedy and want another separate openemr docker going. can do this by running another openemr docker (this time will take advantage of the environment variables to ensure the sql database and sql user do not conflict with the current openemr docker):

docker run --detach -p 82:80 --name openemr_2 --env "MYSQL_HOST=mysql" --env "MYSQL_ROOT_PASS=root" --env "MYSQL_USER=openemr_2" --env "MYSQL_PASS=openemr_2" --env "MYSQL_DATABASE=openemr_2" --net mynet openemr/openemr

(again, give it a couple minutes to go through the automated install/configure process) After couple minutes, then click on the '82' link to go to the new openemr instance you just created.

Again, type ‘docker ps -a’ in the shell to see the active dockers (ie. containers). And type ‘docker images’ to see the images that these containers are derived from.

Note that the second openemr container you started is using the current mysql container (can see the database in phpmyadmin). If looking for a little challenge (and will help further learn how cool dockers are), could try the following exercise:
Create another separate mysql container and then create another openemr container that uses it. And then create another phpmyadmin container that connect to the separate mysql container.(hint: do not create another network; this can be done by just using appropriate --env and --name settings)

-brady


(Brady Miller) #5

Hi,

Thanks to @toolbox , there have been several improvements to the OpenEMR dockers:

  1. dockers support 443/ssl (can even use letsencrypt!)
  2. a docker with most recent development codebase is now also available (plan to update it weekly or so from the development codebase)

See here for details:
https://hub.docker.com/r/openemr/openemr/

-brady


(Brady Miller) #6

Hi,

Some more fun docker stuff.

For those folks that wish to quickly test the most recent codebase(this development docker gets updated about once every week with the most recent codebase), it’s easy and fun to use the process described above for labs.play-with-docker.com, but change it a little.

Can do this per the following instructions:
go straight to labs.play-with-docker.com (you need to login to use this site; you need to create an account at https://hub.docker.com/ and then use these credentials to log into labs.play-with-docker.com). Then click ‘Add New Instance’ at the left and a new shell will open for you. Then copy/paste the four commands below:

docker network create mynet
docker run --detach --name mysql --env "MYSQL_ROOT_PASSWORD=root" --net mynet mysql --character-set-server=utf8
docker run --detach -p 81:80 --name phpmyadmin --env "PMA_HOST=mysql" --net mynet phpmyadmin/phpmyadmin
docker run --detach -p 80:80 --name openemr --env "MYSQL_HOST=mysql" --env "MYSQL_ROOT_PASS=root" --net mynet openemr/openemr:dev

Let this go for about 4-5 minutes. After that time, click on the ‘81’ link at the top, and it will take you to phpmyadmin (root:root credentials) and you can see the openemr database there. And then click on the ‘80’ link at the top, and it will take you to the OpenEMR login screen(admin:pass credentials). So you can now play around with OpenEMR development version and the database anywhere you have access to a web browser!

To break down the above 4 commands above. First command sets up the network that the 3 dockers will use so they can communicate. Second command runs the mysql docker. Third command runs the phpmyadmin docker. Fourth command runs the openemr docker(and note it uses the dev tag, which is what tells it to use the development docker).

-brady


(Brady Miller) #7

Some more fun docker stuff to do can be found here:


(Jim Chan) #8

congrats. I’d like to check this out sometime. working on a first implementation right now though


(Brady Miller) #9

Hi,

Just added a cool docker that allows testing and evaluation of development codebase and features. It is called flex, and will roll out an openemr docker from any specified public git repository.

For example:
go straight to labs.play-with-docker.com (you need to login to use this site; you need to create an account at https://hub.docker.com/ and then use these credentials to log into labs.play-with-docker.com). Then click ‘Add New Instance’ at the left and a new shell will open for you. Then copy/paste the four commands below:

docker network create mynet
docker run --detach --name mysql --env "MYSQL_ROOT_PASSWORD=root" --net mynet mysql --character-set-server=utf8
docker run --detach -p 81:80 --name phpmyadmin --env "PMA_HOST=mysql" --net mynet phpmyadmin/phpmyadmin
docker run --detach -p 80:80 --name openemr --env "MYSQL_HOST=mysql" --env "MYSQL_ROOT_PASS=root" --env "FLEX_REPOSITORY=https://github.com/openemr/openemr.git" --env "FLEX_REPOSITORY_BRANCH=master" --net mynet openemr/openemr:flex

Let this go for about 4-5 minutes. After that time, click on the ‘81’ link at the top, and it will take you to phpmyadmin (root:root credentials) and you can see the openemr database there. And then click on the ‘80’ link at the top, and it will take you to the OpenEMR login screen(admin:pass credentials). So you can now play around with any OpenEMR version from any git public repository anywhere you have access to a web browser!

To break down the above 4 commands above. First command sets up the network that the 3 dockers will use so they can communicate. Second command runs the mysql docker. Third command runs the phpmyadmin docker. Fourth command runs the openemr flex docker(and note it uses the flex tag, which is what tells it to use the flex docker); note
the FLEX_REPOSITORY specifies the git repository and the FLEX_REPOSITORY_BRANCH specifies the branch in this git repository (the above example is taking the most recent development codebase from the official openemr git repository).

gotta love these dockers!
-brady


(Brady Miller) #10

Hi,
Time for some more fun with dockers. With just the click of a button in this post, you can start up your own demos for OpenEMR version 5.0.0 docker, OpenEMR development version 5.0.1 docker, OpenEMR development version 5.0.2 docker, or OpenEMR flex docker.

OpenEMR version 5.0.0 (note this is an OLD version):
Try it!

OpenEMR version 5.0.1 (the most recent version):
Try it!

OpenEMR development version 5.0.2:
Try it!

OpenEMR flex (ie. most recent development codebase):
Try it!

Clicking on the above button(s) will take you to labs.play-with-docker.com (you need to login to use this site; you need to create an account at hub.docker.com and then use these credentials to log into labs.play-with-docker.com) where your very own requested demo will be magically built.
Let the process go for about 4-5 minutes. After that time, click on the the ‘80’ link at the top, and it will take you to the OpenEMR login screen(admin:pass credentials) of your very own demo.

-brady


Demo farm and up for grabs demos are back!
Adodb-mysql_log.inc.php
(Brady Miller) #11

Hi,

Some more cool docker stuff is available. We have added plug and play (at least hopefully it is plug and play) support for a dockerized openemr environment for developers and testers. Can check out how you can get it going here:
openemr/README.md at master · openemr/openemr · GitHub

-brady


(Brady Miller) #12

See this post for example of using OpenEMR docker:


(Brady Miller) #13

Hi,

Another cool docker update/example. Because of @gutiersa, OpenEMR now works with nginx. I incorporated this into a docker solution/stack, which demonstrates the use of the same OpenEMR instance on nginx and apache.

To see this in action, click on the following which is OpenEMR development version 5.0.2 using both apache and nginx:
Try it!

Clicking on the above button(s) will take you to labs.play-with-docker.com (you need to login to use this site; you need to create an account at hub.docker.com and then use these credentials to log into labs.play-with-docker.com) where your very own requested demo will be magically built.

Let the process go for about 4-5 minutes. And then will see the following ports to try:
Port 80 is nginx with php 7.1
Port 81 is nginx with php 7.2
Port 82 is apache/php (the standard docker use)

Note they are all using the same openemr instance and here is the docker-composer.yml that builds this stack: https://gist.github.com/bradymiller/fb8f0fbf9fff74b7666a217f0e9c28a1 )

-brady


(Brady Miller) #14

Here’s a related thread on Docker Swarm for OpenEMR: