Skip to content

Commit 7973bcb

Browse files
authored
prep for rel-702 (#373)
* prep for rel-702 * fix
1 parent 0d7cbf0 commit 7973bcb

22 files changed

+3560
-2
lines changed

.github/workflows/build-702.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: docker/build-push-action@v3
2525
with:
2626
context: "{{defaultContext}}:docker/openemr/7.0.2"
27-
tags: openemr/openemr:7.0.2 , openemr/openemr:next , openemr/openemr:dev
27+
tags: openemr/openemr:7.0.2 , openemr/openemr:next
2828
platforms: linux/amd64,linux/arm64,linux/arm/v7
2929
push: true
3030
no-cache: true

.github/workflows/build-703.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Development 7.0.3 Docker Nightly Build
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 2 * * *' # run at 2 AM UTC
7+
8+
jobs:
9+
build:
10+
# Only run from master branch on the main repository
11+
if: github.repository_owner == 'openemr' && github.repository == 'openemr/openemr-devops' && github.ref == 'refs/heads/master'
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- name: Set up QEMU
15+
uses: docker/setup-qemu-action@v2
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v2
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v2
20+
with:
21+
username: ${{ secrets.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
- name: Build and push 7.0.3 docker
24+
uses: docker/build-push-action@v3
25+
with:
26+
context: "{{defaultContext}}:docker/openemr/7.0.3"
27+
tags: openemr/openemr:7.0.3 , openemr/openemr:dev
28+
platforms: linux/amd64,linux/arm64,linux/arm/v7
29+
push: true
30+
no-cache: true

docker/openemr/7.0.2/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN cp /usr/bin/php82 /usr/bin/php
2121
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
2222

2323
RUN apk add --no-cache git build-base \
24-
&& git clone https://github.com/openemr/openemr.git --depth 1 \
24+
&& git clone https://github.com/openemr/openemr.git --branch rel-702 --depth 1 \
2525
&& rm -rf openemr/.git \
2626
&& cd openemr \
2727
&& composer install --no-dev \

docker/openemr/7.0.3/.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.gitignore
2+
docker-compose*yml

docker/openemr/7.0.3/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker-compose.yml

docker/openemr/7.0.3/Dockerfile

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
FROM alpine:3.18
2+
3+
#Install dependencies and fix issue in apache
4+
RUN apk --no-cache upgrade
5+
RUN apk add --no-cache \
6+
apache2 apache2-ssl apache2-utils git php82 php82-tokenizer php82-ctype php82-session php82-apache2 \
7+
php82-json php82-pdo php82-pdo_mysql php82-curl php82-ldap php82-openssl php82-iconv \
8+
php82-xml php82-xsl php82-gd php82-zip php82-soap php82-mbstring php82-zlib \
9+
php82-mysqli php82-sockets php82-xmlreader php82-redis php82-simplexml php82-xmlwriter php82-phar php82-fileinfo \
10+
php82-sodium php82-calendar php82-intl php82-opcache php82-pecl-apcu \
11+
perl mysql-client tar curl imagemagick nodejs npm \
12+
certbot openssl openssl-dev dcron \
13+
rsync shadow ncurses \
14+
&& sed -i 's/^Listen 80$/Listen 0.0.0.0:80/' /etc/apache2/httpd.conf
15+
# Needed to ensure permissions work across shared volumes with openemr, nginx, and php-fpm dockers
16+
RUN usermod -u 1000 apache
17+
18+
#BELOW LINE NEEDED TO SUPPORT PHP8 ON ALPINE 3.13+; SHOULD BE ABLE TO REMOVE THIS IN FUTURE ALPINE VERSIONS
19+
RUN cp /usr/bin/php82 /usr/bin/php
20+
# Install composer for openemr package building
21+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
22+
23+
RUN apk add --no-cache git build-base \
24+
&& git clone https://github.com/openemr/openemr.git --depth 1 \
25+
&& rm -rf openemr/.git \
26+
&& cd openemr \
27+
&& composer install --no-dev \
28+
&& npm install --unsafe-perm \
29+
&& npm run build \
30+
&& cd ccdaservice \
31+
&& npm install --unsafe-perm \
32+
&& cd ../ \
33+
&& composer global require phing/phing \
34+
&& /root/.composer/vendor/bin/phing vendor-clean \
35+
&& /root/.composer/vendor/bin/phing assets-clean \
36+
&& composer global remove phing/phing \
37+
&& composer dump-autoload --optimize --apcu \
38+
&& composer clearcache \
39+
&& npm cache clear --force \
40+
&& rm -fr node_modules \
41+
&& cd ../ \
42+
&& chmod 666 openemr/sites/default/sqlconf.php \
43+
&& chown -R apache openemr/ \
44+
&& mv openemr /var/www/localhost/htdocs/ \
45+
&& mkdir -p /etc/ssl/certs /etc/ssl/private \
46+
&& apk del --no-cache git build-base \
47+
&& sed -i 's/^ *CustomLog/#CustomLog/' /etc/apache2/httpd.conf \
48+
&& sed -i 's/^ *ErrorLog/#ErrorLog/' /etc/apache2/httpd.conf \
49+
&& sed -i 's/^ *CustomLog/#CustomLog/' /etc/apache2/conf.d/ssl.conf \
50+
&& sed -i 's/^ *TransferLog/#TransferLog/' /etc/apache2/conf.d/ssl.conf
51+
WORKDIR /var/www/localhost/htdocs/openemr
52+
VOLUME [ "/etc/letsencrypt/", "/etc/ssl" ]
53+
#configure apache & php properly
54+
ENV APACHE_LOG_DIR=/var/log/apache2
55+
COPY php.ini /etc/php82/php.ini
56+
COPY openemr.conf /etc/apache2/conf.d/
57+
#add runner and auto_configure and prevent auto_configure from being run w/o being enabled
58+
COPY openemr.sh ssl.sh xdebug.sh auto_configure.php /var/www/localhost/htdocs/openemr/
59+
COPY utilities/unlock_admin.php utilities/unlock_admin.sh /root/
60+
RUN chmod 500 openemr.sh ssl.sh xdebug.sh /root/unlock_admin.sh \
61+
&& chmod 000 auto_configure.php /root/unlock_admin.php
62+
#bring in pieces used for automatic upgrade process
63+
COPY upgrade/docker-version \
64+
upgrade/fsupgrade-1.sh \
65+
upgrade/fsupgrade-2.sh \
66+
upgrade/fsupgrade-3.sh \
67+
upgrade/fsupgrade-4.sh \
68+
upgrade/fsupgrade-5.sh \
69+
/root/
70+
RUN chmod 500 \
71+
/root/fsupgrade-1.sh \
72+
/root/fsupgrade-2.sh \
73+
/root/fsupgrade-3.sh \
74+
/root/fsupgrade-4.sh \
75+
/root/fsupgrade-5.sh
76+
#fix issue with apache2 dying prematurely
77+
RUN mkdir -p /run/apache2
78+
#Copy dev tools library to root
79+
COPY utilities/devtoolsLibrary.source /root/
80+
#Ensure swarm/orchestration pieces are available if needed
81+
RUN mkdir /swarm-pieces \
82+
&& rsync --owner --group --perms --delete --recursive --links /etc/ssl /swarm-pieces/ \
83+
&& rsync --owner --group --perms --delete --recursive --links /var/www/localhost/htdocs/openemr/sites /swarm-pieces/
84+
#go
85+
CMD [ "./openemr.sh" ]
86+
87+
EXPOSE 80 443

docker/openemr/7.0.3/README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# OpenEMR Official Docker Image
2+
3+
The docker image is maintained at https://hub.docker.com/r/openemr/openemr/
4+
(see there for more details)
5+
6+
## Tags
7+
8+
See the https://hub.docker.com/r/openemr/openemr/ page for documentation of tags and their current aliases.
9+
10+
It is recommended to specify a version number in production, to ensure your build process pulls what you expect it to.
11+
12+
## How can I just spin up OpenEMR?
13+
14+
*You **need** to run an instance of mysql/mariadb as well and connect it to this container! You can then either use auto-setup with environment variables (see below) or you can manually set up, telling the server where to find the db.* The easiest way is to use `docker-compose`. The following `docker-compose.yml` file is a good example:
15+
- If you are using Raspberry Pi, then change the `mariadb:10.11` to `jsurf/rpi-mariadb`.
16+
```yaml
17+
# Use admin/pass as user/password credentials to login to openemr (from OE_USER and OE_PASS below)
18+
# MYSQL_HOST and MYSQL_ROOT_PASS are required for openemr
19+
# MYSQL_USER, MYSQL_PASS, OE_USER, MYSQL_PASS are optional for openemr and
20+
# if not provided, then default to openemr, openemr, admin, and pass respectively.
21+
version: '3.1'
22+
services:
23+
mysql:
24+
restart: always
25+
image: mariadb:10.11
26+
command: ['mysqld','--character-set-server=utf8mb4']
27+
volumes:
28+
- databasevolume:/var/lib/mysql
29+
environment:
30+
MYSQL_ROOT_PASSWORD: root
31+
openemr:
32+
restart: always
33+
image: openemr/openemr:7.0.3
34+
ports:
35+
- 80:80
36+
- 443:443
37+
volumes:
38+
- logvolume01:/var/log
39+
- sitevolume:/var/www/localhost/htdocs/openemr/sites
40+
environment:
41+
MYSQL_HOST: mysql
42+
MYSQL_ROOT_PASS: root
43+
MYSQL_USER: openemr
44+
MYSQL_PASS: openemr
45+
OE_USER: admin
46+
OE_PASS: pass
47+
depends_on:
48+
- mysql
49+
volumes:
50+
logvolume01: {}
51+
sitevolume: {}
52+
databasevolume: {}
53+
```
54+
[![Try it!](https://github.com/play-with-docker/stacks/raw/cff22438cb4195ace27f9b15784bbb497047afa7/assets/images/button.png)](http://play-with-docker.com/?stack=https://gist.githubusercontent.com/bradymiller/cecc3159ce806aa520712bb2e1379392/raw/70e97b2ea90b555f16386c4403194c5cc709ec94/openemr-703-docker-example-docker-compose.yml)
55+
56+
## Environment Variables
57+
58+
See the https://hub.docker.com/r/openemr/openemr/ page for documentation of environment variables.
59+
60+
## Support on Raspberry Pi
61+
62+
Both 32 bit and 64 bit architectures are supported on Raspberry Pi. If you are using Raspberry Pi, then you need to change the `mariadb:10.11` to `jsurf/rpi-mariadb` in the above docker-compose.yml example.
63+
64+
## Where to get help?
65+
66+
For general knowledge, our [wiki](https://www.open-emr.org/wiki) is a repository of helpful information. The [Forum](https://community.open-emr.org/) are a great source for assistance and news about emerging features. We also have a [Chat](https://www.open-emr.org/chat/) system for real-time advice and to coordinate our development efforts.
67+
68+
## How can I contribute?
69+
70+
The OpenEMR community is a vibrant and active group, and people from any background can contribute meaningfully, whether they are optimizing our DB calls, or they're doing translations to their native tongue. Feel free to reach out to us at via [Chat](https://www.open-emr.org/chat/)!
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
require_once('/var/www/localhost/htdocs/openemr/vendor/autoload.php');
3+
// Set up default configuration settings
4+
$installSettings = array();
5+
$installSettings['iuser'] = 'admin';
6+
$installSettings['iuname'] = 'Administrator';
7+
$installSettings['iuserpass'] = 'pass';
8+
$installSettings['igroup'] = 'Default';
9+
$installSettings['server'] = 'localhost'; // mysql server
10+
$installSettings['loginhost'] = 'localhost'; // php/apache server
11+
$installSettings['port'] = '3306';
12+
$installSettings['root'] = 'root';
13+
$installSettings['rootpass'] = 'BLANK';
14+
$installSettings['login'] = 'openemr';
15+
$installSettings['pass'] = 'openemr';
16+
$installSettings['dbname'] = 'openemr';
17+
$installSettings['collate'] = 'utf8mb4_general_ci';
18+
$installSettings['site'] = 'default';
19+
$installSettings['source_site_id'] = 'BLANK';
20+
$installSettings['clone_database'] = 'BLANK';
21+
$installSettings['no_root_db_access'] = 'BLANK';
22+
$installSettings['development_translations'] = 'BLANK';
23+
// Collect parameters(if exist) for installation configuration settings
24+
for ($i=1; $i < count($argv); $i++) {
25+
$indexandvalue = explode("=", $argv[$i]);
26+
$index = $indexandvalue[0];
27+
$value = $indexandvalue[1] ?? '';
28+
$installSettings[$index] = $value;
29+
}
30+
// Convert BLANK settings to empty
31+
$tempInstallSettings = array();
32+
foreach ($installSettings as $setting => $value) {
33+
if ($value == "BLANK") {
34+
$value = '';
35+
}
36+
$tempInstallSettings[$setting] = $value;
37+
}
38+
$installSettings = $tempInstallSettings;
39+
// Install and configure OpenEMR using the Installer class
40+
$installer = new Installer($installSettings);
41+
if (! $installer->quick_install()) {
42+
// Failed, report error
43+
throw new Exception("ERROR: " . $installer->error_message . "\n");
44+
} else {
45+
// Successful
46+
echo $installer->debug_message . "\n";
47+
}

docker/openemr/7.0.3/openemr.conf

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
LoadModule rewrite_module modules/mod_rewrite.so
2+
LoadModule allowmethods_module modules/mod_allowmethods.so
3+
4+
## Security Options
5+
# Strong HTTP Protocol
6+
HTTPProtocolOptions Strict
7+
Protocols http/1.1
8+
# Don't Reveal Server
9+
ServerSignature off
10+
ServerTokens Prod
11+
Header unset Server
12+
# No ETag
13+
FileETag None
14+
Header unset ETag
15+
# Set HSTS and X-XSS protection
16+
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
17+
Header set X-XSS-Protection "1; mode=block"
18+
# Narrow document root
19+
DocumentRoot /var/www/localhost/htdocs/openemr
20+
21+
# These are the overrides if a virtual host does not exist.
22+
ErrorLog "|/usr/sbin/rotatelogs -n 5 ${APACHE_LOG_DIR}/error.log 86400"
23+
CustomLog "|/usr/sbin/rotatelogs -n 5 ${APACHE_LOG_DIR}/access.log 86400" combined
24+
25+
<Directory /var/www/localhost/htdocs/openemr>
26+
# Only allow these HTTP Methods
27+
AllowMethods GET POST PUT DELETE HEAD OPTIONS
28+
# No indexes anywhere
29+
Options -Indexes
30+
AllowOverride FileInfo
31+
Require all granted
32+
</Directory>
33+
34+
<Directory "/var/www/localhost/htdocs/openemr/sites">
35+
AllowOverride None
36+
</Directory>
37+
38+
<Directory "/var/www/localhost/htdocs/openemr/sites/*/documents">
39+
Require all denied
40+
</Directory>
41+
42+
#######################################
43+
### Uncomment the following 3 lines ###
44+
### with #'s below to enable HTTPS ###
45+
### redirection & require HTTPS only ##
46+
#######################################
47+
<VirtualHost *:80>
48+
#RewriteEngine On
49+
#RewriteCond %{HTTPS} off
50+
#RewriteRule (.*) https://%{HTTP_HOST}/$1 [R,L]
51+
</VirtualHost>
52+
53+
<VirtualHost _default_:443>
54+
# SSL Engine Switch:
55+
# Enable/Disable SSL for this virtual host.
56+
SSLEngine on
57+
58+
# Used following tool to produce below ciphers and protocol (only TLSv1.2 and TLSv1.3) and related settings :
59+
# https://ssl-config.mozilla.org/#server=apache&version=2.4.48&config=intermediate&openssl=1.1.1&hsts=false&ocsp=false&guideline=5.6
60+
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
61+
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
62+
SSLHonorCipherOrder off
63+
SSLSessionTickets off
64+
65+
SSLCertificateFile /etc/ssl/certs/webserver.cert.pem
66+
SSLCertificateKeyFile /etc/ssl/private/webserver.key.pem
67+
</VirtualHost>

0 commit comments

Comments
 (0)