Skip to content

Commit

Permalink
docker reorg (openemr#4004)
Browse files Browse the repository at this point in the history
docker reorg

Co-authored-by: Asher Densmore-Lynn <[email protected]>
  • Loading branch information
bradymiller and jesdynf authored Nov 1, 2020
1 parent 709b130 commit 2790d4b
Show file tree
Hide file tree
Showing 98 changed files with 217 additions and 58 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You will need a "local" version of OpenEMR to make changes to the source code. T
- If you want to set up the base services(e.g. git, docker, docker-compose, openemr-cmd, minkube and kubectl) easily, please try [openemr-env-installer](https://github.com/openemr/openemr-devops/tree/master/utilities/openemr-env-installer)
- It's best to also add an `upstream` origin to keep your local fork up to date. [Check out this guide](https://oneemptymind.wordpress.com/2018/07/11/keeping-a-fork-up-to-date/) for more info.
- If you haven't already, [install git](https://git-scm.com/downloads) for your system
2. `cd openemr` (the directory you cloned the code into)
2. `cd openemr/docker/development-easy` (if you are running this on Raspberry Pi, then instead do `cd openemr/docker/development-easy-arm`)
- If you haven't already, [install Docker](https://docs.docker.com/install/) and [install compose](https://docs.docker.com/compose/install/) for your system
- If you want to troubleshoot with the below steps easier, please also [install openemr-cmd](https://github.com/openemr/openemr-devops/tree/master/utilities/openemr-cmd) for your system
- If you want to monitor and easily manage the docker environment, please also [install openemr-monitor](https://github.com/openemr/openemr-devops/tree/master/utilities/openemr-monitor) and [install portainer](https://github.com/openemr/openemr-devops/tree/master/utilities/portainer) for your system
Expand Down
26 changes: 19 additions & 7 deletions DOCKER_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,29 @@ with tags such as `5.0.2` and `latest`. Development dockers are meant for develo

## Production Dockers
Production dockers are meant for production use with tags such as `5.0.2` and `latest` and can be found
on [dockerhub](https://hub.docker.com/r/openemr/openemr/). An example docker-compose.yml script can be
found in the `docker` directory at [docker/docker-compose.yml](docker/docker-compose.yml). After modifying the
on [dockerhub](https://hub.docker.com/r/openemr/openemr/). Several example docker-compose.yml scripts are
discussed below.

### Production example
An example docker-compose.yml script can be found at
[docker/production/docker-compose.yml](docker/production/docker-compose.yml). After modifying the
script for your purposes, it can then be started with `docker-compose up`, which will then take about 5-10
minutes to complete. Note that this example is based on OpenEMR 6.0.0, which is considered development
until official release of version 6.0.0.

### Production example for Raspberry Pi
An example docker-compose.yml script for Raspberry Pi can be found at
[docker/production-arm/docker-compose.yml](docker/production-arm/docker-compose.yml). After modifying the
script for your purposes, it can then be started with `docker-compose up`, which will then take about 5-10
minutes to complete.
minutes to complete. Note that this example is based on OpenEMR 6.0.0, which is considered development
until official release of version 6.0.0.

## Development Dockers
Development dockers are meant for development and include the `flex` series and can be found on
[dockerhub](https://hub.docker.com/r/openemr/openemr/). It is strongly recommended to not use these dockers
for production purposes unless you know what you are doing. There are 2 OpenEMR development environments,
which are based on these development dockers. The main development environment is the Easy Development Docker
environment, which is documented at [CONTRIBUTING.md](CONTRIBUTING.md#code-contributions-local-development)
and [contrib/util/docker/README.md](contrib/util/docker/README.md#easy-development-docker-environment). The other
development environment, which is much more complex, is the Insane Development Docker environment, which is
documented at [contrib/util/docker/README.md](contrib/util/docker/README.md#insane-development-docker-environment).
environment, which is documented at [CONTRIBUTING.md](CONTRIBUTING.md#code-contributions-local-development);
note this environment can also be run on Raspberry Pi. The other development environment, which is much more
complex, is the Insane Development Docker environment, which is documented at
[docker/development-insane/README.md](docker/development-insane/README.md#insane-development-docker-environment).
2 changes: 2 additions & 0 deletions docker/development-easy-arm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Easy Development Docker Environment for Raspberry Pi
The instructions for The Easy Development Docker environment can be found at [CONTRIBUTING.md](../../CONTRIBUTING.md#code-contributions-local-development).
114 changes: 114 additions & 0 deletions docker/development-easy-arm/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Use admin/pass as user/password credentials to login to openemr (from OE_USER and OE_PASS below)
# MYSQL_HOST and MYSQL_ROOT_PASS are required for openemr
# EASY_DEV_MODE prevents issues with permissions when mounting volumes
# EAST_DEV_MODE_NEW with value of 'yes' expands EASY_DEV_MODE by not requiring downloading
# code from github (uses local repo).
# MYSQL_USER, MYSQL_PASS, OE_USER, MYSQL_PASS are optional for openemr and
# if not provided, then default to openemr, openemr, admin, and pass respectively.
version: '3.1'
services:
mysql:
restart: always
image: jsurf/rpi-mariadb
command: ['mysqld','--character-set-server=utf8mb4','--ssl-ca=/etc/ssl/ca.pem','--ssl_cert=/etc/ssl/server-cert.pem','--ssl_key=/etc/ssl/server-key.pem']
ports:
- 8320:3306
volumes:
- ../development-insane/sql-ssl-certs-keys/easy/ca.pem:/etc/ssl/ca.pem:ro
- ../development-insane/sql-ssl-certs-keys/easy/server-cert.pem:/etc/ssl/server-cert.pem:ro
- ../development-insane/sql-ssl-certs-keys/easy/server-key.pem:/etc/ssl/server-key.pem:ro
- databasevolume:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
openemr:
restart: always
# use an image if you're not changing the build steps:
image: openemr/openemr:flex
# if editing the Dockerfile, clone the devops repo and point to the path:
# build: ../openemr-devops/docker/openemr/flex-edge/
ports:
- 8300:80
- 9300:443
volumes:
- ../..:/openemr:ro
- ../..:/var/www/localhost/htdocs/openemr:rw
- publicvolume:/var/www/localhost/htdocs/openemr/public:rw
- sitesvolume:/var/www/localhost/htdocs/openemr/sites:rw
- nodemodules:/var/www/localhost/htdocs/openemr/node_modules:rw
- vendordir:/var/www/localhost/htdocs/openemr/vendor:rw
- ccdamodule:/var/www/localhost/htdocs/openemr/ccdaservice:rw
- logvolume:/var/log
- couchdbvolume:/couchdb/data
environment:
MYSQL_HOST: mysql
MYSQL_ROOT_PASS: root
MYSQL_USER: openemr
MYSQL_PASS: openemr
OE_USER: admin
OE_PASS: pass
EASY_DEV_MODE: "yes"
EASY_DEV_MODE_NEW: "yes"
# e2e requires chromium, which alpine isn't giving us in arm
# TODO, need to add more granular setting for this to allow other composer developer dependencies, but not e2e
DEVELOPER_TOOLS: "no"
XDEBUG_IDE_KEY: PHPSTORM
XDEBUG_PROFILER_ON: 1
GITHUB_COMPOSER_TOKEN: c313de1ed5a00eb6ff9309559ec9ad01fcc553f0
OPENEMR_DOCKER_ENV_TAG: easy-dev-docker
OPENEMR_SETTING_rest_api: 1
OPENEMR_SETTING_rest_fhir_api: 1
OPENEMR_SETTING_rest_portal_api: 1
OPENEMR_SETTING_rest_portal_fhir_api: 1
OPENEMR_SETTING_portal_onsite_two_enable: 1
OPENEMR_SETTING_ccda_alt_service_enable: 3
OPENEMR_SETTING_couchdb_host: couchdb
OPENEMR_SETTING_couchdb_port: 6984
OPENEMR_SETTING_couchdb_user: admin
OPENEMR_SETTING_couchdb_pass: password
OPENEMR_SETTING_couchdb_dbase: example
OPENEMR_SETTING_couchdb_ssl_allow_selfsigned: 1
OPENEMR_SETTING_user_debug: 3
OPENEMR_SETTING_gbl_ldap_host: 'ldap:https://openldap:389'
OPENEMR_SETTING_gbl_ldap_dn: 'cn={login},dc=example,dc=org'
depends_on:
- mysql
phpmyadmin:
restart: always
image: phpmyadmin/phpmyadmin
ports:
- 8310:80
environment:
PMA_HOSTS: mysql
couchdb:
restart: always
image: couchdb
ports:
- 5984:5984
- 6984:6984
volumes:
- ../development-insane/couchdb-config-ssl-cert-keys/local.ini:/opt/couchdb/etc/local.ini:rw
- ../development-insane/couchdb-config-ssl-cert-keys/easy/ca.pem:/etc/ssl/ca.pem:ro
- ../development-insane/couchdb-config-ssl-cert-keys/easy/server-cert.pem:/etc/ssl/server-cert.pem:ro
- ../development-insane/couchdb-config-ssl-cert-keys/easy/server-key.pem:/etc/ssl/server-key.pem:ro
- couchdbvolume:/opt/couchdb/data
environment:
COUCHDB_USER: admin
COUCHDB_PASSWORD: password
#maybe later
#openldap:
# restart: always
# image: openemr/dev-ldap:easy
# environment:
# LDAP_TLS_VERIFY_CLIENT: try
# LDAP_TLS_CA_CRT_FILENAME: ca.pem
# LDAP_TLS_CRT_FILENAME: server-cert.pem
# LDAP_TLS_KEY_FILENAME: server-key.pem
volumes:
databasevolume: {}
publicvolume: {}
sitesvolume: {}
nodemodules: {}
vendordir: {}
ccdamodule: {}
logvolume: {}
couchdbvolume: {}
2 changes: 2 additions & 0 deletions docker/development-easy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Easy Development Docker Environment
The instructions for The Easy Development Docker environment can be found at [CONTRIBUTING.md](../../CONTRIBUTING.md#code-contributions-local-development).
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ services:
ports:
- 8320:3306
volumes:
- ./contrib/util/docker/sql-ssl-certs-keys/easy/ca.pem:/etc/ssl/ca.pem:ro
- ./contrib/util/docker/sql-ssl-certs-keys/easy/server-cert.pem:/etc/ssl/server-cert.pem:ro
- ./contrib/util/docker/sql-ssl-certs-keys/easy/server-key.pem:/etc/ssl/server-key.pem:ro
- ../development-insane/sql-ssl-certs-keys/easy/ca.pem:/etc/ssl/ca.pem:ro
- ../development-insane/sql-ssl-certs-keys/easy/server-cert.pem:/etc/ssl/server-cert.pem:ro
- ../development-insane/sql-ssl-certs-keys/easy/server-key.pem:/etc/ssl/server-key.pem:ro
- databasevolume:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
Expand All @@ -30,8 +30,8 @@ services:
- 8300:80
- 9300:443
volumes:
- .:/openemr:ro
- .:/var/www/localhost/htdocs/openemr:rw
- ../..:/openemr:ro
- ../..:/var/www/localhost/htdocs/openemr:rw
- publicvolume:/var/www/localhost/htdocs/openemr/public:rw
- sitesvolume:/var/www/localhost/htdocs/openemr/sites:rw
- nodemodules:/var/www/localhost/htdocs/openemr/node_modules:rw
Expand Down Expand Up @@ -84,10 +84,10 @@ services:
- 5984:5984
- 6984:6984
volumes:
- ./contrib/util/docker/couchdb-config-ssl-cert-keys/local.ini:/opt/couchdb/etc/local.ini:rw
- ./contrib/util/docker/couchdb-config-ssl-cert-keys/easy/ca.pem:/etc/ssl/ca.pem:ro
- ./contrib/util/docker/couchdb-config-ssl-cert-keys/easy/server-cert.pem:/etc/ssl/server-cert.pem:ro
- ./contrib/util/docker/couchdb-config-ssl-cert-keys/easy/server-key.pem:/etc/ssl/server-key.pem:ro
- ../development-insane/couchdb-config-ssl-cert-keys/local.ini:/opt/couchdb/etc/local.ini:rw
- ../development-insane/couchdb-config-ssl-cert-keys/easy/ca.pem:/etc/ssl/ca.pem:ro
- ../development-insane/couchdb-config-ssl-cert-keys/easy/server-cert.pem:/etc/ssl/server-cert.pem:ro
- ../development-insane/couchdb-config-ssl-cert-keys/easy/server-key.pem:/etc/ssl/server-key.pem:ro
- couchdbvolume:/opt/couchdb/data
environment:
COUCHDB_USER: admin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# OpenEMR Development Docker Environments

## There are 2 different development docker environments

### Easy Development Docker Environment ###
The Easy Development Docker Environment is what we highly recommend. It makes testing, development, and use
of a git repository very easy. The instructions for The Easy Development Docker environment can be found here:
https://github.com/openemr/openemr/blob/master/CONTRIBUTING.md#code-contributions-local-development

---

### Insane Development Docker Environment ###
The Insane Development Docker Environment will load up about 37 separate dockers and allow you to
test almost any version of mysql/mariadb/php, however it is not nearly as easy to use as the above Easy Development
Expand All @@ -33,13 +22,13 @@ There are 2 different schools of thought on where to run the docker from.
- Option 1. Run the docker from within your git repository.(this is also where you edit
scripts in your editor)
```bash
$ cd openemr/contrib/util/docker
$ cd openemr/docker/development-insane
$ docker-compose up -d
```
- Option 2. Run the docker from a separate directory that is synchronized with your git
repository. For example, if used /var/www/openemr.
```bash
$ cd /var/www/openemr/contrib/util/docker
$ cd /var/www/openemr/docker/development-insane
$ docker-compose up -d
```
- At this time, I highly recommend option 2 since running OpenEMR will change
Expand Down
Loading

0 comments on commit 2790d4b

Please sign in to comment.