-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: transition apache to use php-fpm/fcgi in dockers #385
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,20 +3,27 @@ FROM alpine:3.19 | |
#Install dependencies and fix issue in apache | ||
RUN apk --no-cache upgrade | ||
RUN apk add --no-cache \ | ||
apache2 apache2-ssl apache2-utils apache2-proxy git php83 php83-tokenizer php83-ctype php83-session php83-apache2 \ | ||
apache2 apache2-ssl apache2-utils apache2-proxy git php83 php83-fpm php83-tokenizer php83-ctype php83-session \ | ||
php83-json php83-pdo php83-pdo_mysql php83-curl php83-ldap php83-openssl php83-iconv \ | ||
php83-xml php83-xsl php83-gd php83-zip php83-soap php83-mbstring php83-zlib \ | ||
php83-mysqli php83-sockets php83-xmlreader php83-redis php83-simplexml php83-xmlwriter php83-phar php83-fileinfo \ | ||
php83-sodium php83-calendar php83-intl php83-opcache php83-pecl-apcu php83-fpm \ | ||
php83-sodium php83-calendar php83-intl php83-opcache php83-pecl-apcu \ | ||
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 | ||
#STEPS TO ENSURE php and php-fpm/fcgi both work, which configure proper user/group for php-fpm and set the alpine Event MPM | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will need to fix comment above and change |
||
# (NOTE this needs to be modified with each new php version in 4 lines below) | ||
RUN cp /usr/bin/php83 /usr/bin/php | ||
RUN cp /usr/sbin/php-fpm83 /usr/sbin/php-fpm | ||
RUN sed -i "s/^user = [^ ]*/user = apache/" /etc/php83/php-fpm.d/www.conf | ||
RUN sed -i "s/^group = [^ ]*/group = apache/" /etc/php83/php-fpm.d/www.conf | ||
RUN sed -i "/^LoadModule mpm_prefork_module modules\/mod_mpm_prefork.so/ s/^/#/" /etc/apache2/httpd.conf | ||
RUN sed -i "/LoadModule mpm_event_module modules\/mod_mpm_event.so/ s/# *//" /etc/apache2/httpd.conf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. above 2 lines will basically comment out the apache prefork MPM and then uncomment the apache event MPM |
||
|
||
# Install composer for openemr package building | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -452,6 +452,8 @@ echo " > https://opencollective.com/openemr/donate" | |
echo "" | ||
|
||
if [ "$OPERATOR" == "yes" ]; then | ||
echo "Starting php-fpm!" | ||
/usr/sbin/php-fpm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
echo "Starting apache!" | ||
/usr/sbin/httpd -D FOREGROUND | ||
else | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note we are actually removing the php83-apache2 module :)