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