mirror of
https://github.com/hnhx/librex.git
synced 2025-01-09 11:17:25 -03:00
Update Version:
Alpine 3.17->3.18 php7->php8
This commit is contained in:
parent
a75a233fbd
commit
e2eead1ce0
5 changed files with 12 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
# syntax = edrevo/dockerfile-plus
|
||||
ARG VERSION="3.17"
|
||||
ARG VERSION="3.18"
|
||||
FROM alpine:${VERSION} AS librex
|
||||
WORKDIR "/var/www/html"
|
||||
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
sh "docker/php/prepare.sh"
|
||||
sh "docker/server/prepare.sh"
|
||||
|
||||
/bin/sh -c /usr/sbin/php-fpm7
|
||||
/bin/sh -c /usr/sbin/php-fpm8
|
||||
|
||||
exec nginx -g "daemon off;"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Set this argument during build time to indicate that the path is for php's www.conf
|
||||
ARG WWW_CONFIG="/etc/php7/php-fpm.d/www.conf"
|
||||
ARG WWW_CONFIG="/etc/php8/php-fpm.d/www.conf"
|
||||
|
||||
# Configure 'opensearch.xml' with Librex configuration metadata, such as the encoding and the host that stores the site
|
||||
# These configurations will replace the 'opensearch.xml' inside '.dockers/templates' for the best setup for your instance
|
||||
|
@ -52,8 +52,8 @@ ENV CURLOPT_VERBOSE=true
|
|||
|
||||
# Install PHP-FPM using Alpine's package manager, apk
|
||||
# Configure PHP-FPM to listen on a Unix socket instead of a TCP port, which is more secure and efficient
|
||||
RUN apk add php7 php7-fpm php7-dom php7-curl php7-json --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing &&\
|
||||
sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php7\/php-fpm7.sock/' ${WWW_CONFIG} &&\
|
||||
RUN apk add php8 php8-fpm php8-dom php8-curl php8-json --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing &&\
|
||||
sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php8\/php-fpm8.sock/' ${WWW_CONFIG} &&\
|
||||
sed -i 's/^\s*;\s*listen.owner = nobody/listen.owner = nginx/' ${WWW_CONFIG} &&\
|
||||
sed -i 's/^\s*;\s*listen.group = nobody/listen.group = nginx/' ${WWW_CONFIG} &&\
|
||||
sed -i 's/^\s*;\s*listen.mode = 0660/listen.mode = 0660/' ${WWW_CONFIG}
|
||||
|
|
|
@ -5,13 +5,13 @@ echo "[PREPARE] docker/server/prepare.sh'"
|
|||
# Load all environment variables from 'attributes.sh' using the command 'source /path/attributes.sh'
|
||||
source "docker/attributes.sh"
|
||||
|
||||
# This condition creates the Unix socket if 'php-fpm7.sock' does not already exist.
|
||||
# This condition creates the Unix socket if 'php-fpm8.sock' does not already exist.
|
||||
# This fixes an issue where Nginx starts but does not serve content
|
||||
if [ ! -d "/run/php7" ] || [ ! -S "/run/php7/php-fpm7.sock" ]; then
|
||||
mkdir "/run/php7"
|
||||
touch "/run/php7/php-fpm7.sock"
|
||||
chmod 660 "/run/php7/php-fpm7.sock"
|
||||
chown nginx:nginx "/run/php7/php-fpm7.sock"
|
||||
if [ ! -d "/run/php8" ] || [ ! -S "/run/php8/php-fpm8.sock" ]; then
|
||||
mkdir "/run/php8"
|
||||
touch "/run/php8/php-fpm8.sock"
|
||||
chmod 660 "/run/php8/php-fpm8.sock"
|
||||
chown nginx:nginx "/run/php8/php-fpm8.sock"
|
||||
fi
|
||||
|
||||
# The lines below will replace the environment variables in the templates with the corresponding variables listed above. To accomplish this, the GNU 'envsubst' package will be used
|
||||
|
|
|
@ -10,7 +10,7 @@ server {
|
|||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass unix:/run/php7/php-fpm7.sock;
|
||||
fastcgi_pass unix:/run/php8/php-fpm8.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi.conf;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue