This commit is contained in:
eroncero
2025-07-18 09:54:46 +02:00
parent 1a76816275
commit 263f77418a
12 changed files with 46 additions and 28 deletions

View File

@@ -1,13 +1,13 @@
# LEMP Linux NGINX MariaDB PHP # LEMP Linux NGINX MariaDB PHP
services: services:
php-fpm: multi-php-fpm:
restart: unless-stopped restart: unless-stopped
image: eroncero/php-fpm-srv:latest image: eroncero/multi-php-fpm:latest
volumes: volumes:
#- ./etc/php/8.2/fpm/pool.d:/etc/php/8.2/fpm/pool.d #- ./etc/php/8.2/fpm/pool.d:/etc/php/8.2/fpm/pool.d
- php-fpm_pool.d:/etc/php/8.2/fpm/pool.d - multi-php-fpm_pool.d:/etc/php/8.2/fpm/pool.d
- php-fpm_ipc_socketfile:/run/php/ - multi-php-fpm_ipc_socketfile:/run/php/
nginx: nginx:
restart: unless-stopped restart: unless-stopped
@@ -34,10 +34,10 @@ services:
- mysql_ipc_socketfile:/run/mysqld/mysqld.sock - mysql_ipc_socketfile:/run/mysqld/mysqld.sock
volumes: volumes:
php-fpm_pool.d: multi-php-fpm_pool.d:
nginx_sites-available: nginx_sites-available:
mysql_ipc_socketfile: mysql_ipc_socketfile:
php_ipc_socketfile: multi-php-fpm_ipc_socketfile:
nginx_logs: nginx_logs:
nginx_www: nginx_www:
nginx_sites-available: nginx_sites-available:

View File

@@ -0,0 +1,9 @@
#!/bin/sh
/bin/sh /entrypoint/install-php-versions.sh
# Run the CMD that was passed (or default)
#exec "$@"
tail -f /dev/null

View File

@@ -44,3 +44,5 @@ for version in $PHP_VERSIONS; do
done done
update-alternatives --set php /usr/bin/php$DEF_PHP_INTERPRETER update-alternatives --set php /usr/bin/php$DEF_PHP_INTERPRETER
/bin/sh /entrypoint/start-php-fpm.sh

View File

@@ -0,0 +1,21 @@
#!/bin/sh
# Start each version listed in PHP_VERSIONS
for version in $PHP_VERSIONS; do
echo "Starting php$version-fpm..."
service "php$version-fpm" start
done
# Check if BUILDTIME_PHP_VER_INST is defined and not already in PHP_VERSIONS
if [ -n "$BUILDTIME_PHP_VER_INST" ]; then
case " $PHP_VERSIONS " in
*" $BUILDTIME_PHP_VER_INST "*)
echo "BUILDTIME_PHP_VER_INST ($BUILDTIME_PHP_VER_INST) already started."
;;
*)
echo "Starting BUILDTIME_PHP_VER_INST (php$BUILDTIME_PHP_VER_INST-fpm)..."
service "php$BUILDTIME_PHP_VER_INST-fpm" start
;;
esac
fi

View File

@@ -1,3 +1,10 @@
FROM debian:bookworm FROM debian:bookworm
RUN apt-get update; apt-get full-upgrade -y RUN apt-get update; apt-get full-upgrade -y; apt-get autoclean -y
COPY project/buildtime/gen_selfisgned_cert.sh /tmp/buildtime/gen_selfisgned_cert.sh
RUN /bin/sh /tmp/buildtime/gen_selfsigned_cert.sh
COPY project/entrypoint/entrypoint.sh /entrypoint/entrypoint.sh
COPY project/entrypoint/install-nginx-mods.sh /entrypoint/install-nginx-mods.sh
ENTRYPOINT ["/bin/sh", "/entrypoint/entrypoint.sh"]

View File

@@ -1,4 +1,3 @@
#!/bin/sh
# Generate a fresh cert every time # Generate a fresh cert every time
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \ openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
@@ -10,13 +9,3 @@ echo "Generated self-signed cert:"
ls -l /etc/ssl/private/ ls -l /etc/ssl/private/
ls -l /etc/ssl/certs/ ls -l /etc/ssl/certs/
### ###
#service php8.2-fpm start # this should be started later
/bin/sh /entrypoint/install-php-versions.sh
# Run the CMD that was passed (or default)
#exec "$@"
tail -f /dev/null

View File

@@ -1,10 +0,0 @@
#!/bin/sh
apt-get update
echo "Installing PHP versions: $PHP_VERSIONS"
for version in $PHP_VERSIONS; do
echo "Installing PHP $version ..."
service "php$version-fpm" start
done