+ php src container fully refactored and lightweight

* on host system container also refactored, some env options moved from .env to docker-compose example
* dnsmasq now is separate service file
+ php 8.3 support
* xdebug launch also refactored and lightweight
* tested and worked python environment with pyenv (on today without supervisor)
* database container and appropriate gui applications for management database systems moved into separate service files
+ build src php container helper
- remove unnecessary docker compose file version directive
- remove minio thing from the host php services
* use redis-local.conf from example and lightweight main redis conf file
This commit is contained in:
2025-01-13 18:16:42 +03:00
parent 57c56567cf
commit 49e44c9229
77 changed files with 2229 additions and 3192 deletions

View File

@ -3,15 +3,27 @@
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)"
PHP_VERSION=$1 # Without dot
WITH_PROFILER=$2
if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=81; fi
POSSIBLE_XDEBUG_VERSION=xdebug2
PHP_FPM_CONTAINER=$(docker ps | grep "php${PHP_VERSION}" | awk '{print $1}')
WORKSPACE_CONTAINER=$(docker ps | grep "workspace${PHP_VERSION}" | awk '{print $1}')
if [[ $PHP_VERSION -ge 81 ]]; then
POSSIBLE_XDEBUG_VERSION=xdebug3
PHP_FPM_XDEBUG_EXT_PATH=/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
WORKSPACE_XDEBUG_EXT_PATH=/etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini
SED_XDEBUG_ON="sed -i 's/^zend_extension=/;zend_extension=/g'"
docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_XDEBUG_ON} ${PHP_FPM_XDEBUG_EXT_PATH}"
docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_XDEBUG_ON} ${WORKSPACE_XDEBUG_EXT_PATH}"
echo "Choice PHP_VERSION: $PHP_VERSION"
if [ "${PHP_VERSION}" -ne 74 ]; then
SED_DEBUG_OR_PROFILER_MODE_ON="sed -i 's/^xdebug.profiler_enable=.*/xdebug.profiler_enable=0/g'"
else
SED_DEBUG_OR_PROFILER_MODE_ON="sed -i 's/^xdebug.mode=.*/xdebug.mode=off/g'"
fi
${DIR}/dockerfiles/php-fpm/${POSSIBLE_XDEBUG_VERSION}/xdebug.sh stop ${PHP_VERSION} ${WITH_PROFILER}
${DIR}/dockerfiles/workspace/xdebug.sh stop ${PHP_VERSION} ${WITH_PROFILER}
docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_DEBUG_OR_PROFILER_MODE_ON} ${PHP_FPM_XDEBUG_EXT_PATH}"
docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_DEBUG_OR_PROFILER_MODE_ON} ${WORKSPACE_XDEBUG_EXT_PATH}"

View File

@ -7,21 +7,30 @@ WITH_PROFILER=$2
if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=81; fi
POSSIBLE_XDEBUG_VERSION=xdebug2
PHP_FPM_CONTAINER=$(docker ps | grep "php${PHP_VERSION}" | awk '{print $1}')
WORKSPACE_CONTAINER=$(docker ps | grep "workspace${PHP_VERSION}" | awk '{print $1}')
PHP_FPM_XDEBUG_EXT_PATH=/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
WORKSPACE_XDEBUG_EXT_PATH=/etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini
SED_XDEBUG_ON="sed -i 's/^;zend_extension=/zend_extension=/g'"
docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_XDEBUG_ON} ${PHP_FPM_XDEBUG_EXT_PATH}"
docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_XDEBUG_ON} ${WORKSPACE_XDEBUG_EXT_PATH}"
echo "Choice PHP_VERSION: $PHP_VERSION"
if [[ $PHP_VERSION -ge 81 ]]; then
POSSIBLE_XDEBUG_VERSION=xdebug3
if [ "${PHP_VERSION}" -ne 74 ]; then
if [ -n "${WITH_PROFILER}" ]; then
SED_DEBUG_OR_PROFILER_MODE_ON="sed -i 's/^xdebug.profiler_enable=.*/xdebug.profiler_enable=1/g'"
fi
else
if [ -n "${WITH_PROFILER}" ]; then
SED_DEBUG_OR_PROFILER_MODE_ON="sed -i 's/^xdebug.mode=.*/xdebug.mode=profile/g'"
else
SED_DEBUG_OR_PROFILER_MODE_ON="sed -i 's/^xdebug.mode=.*/xdebug.mode=debug/g'"
fi
fi
echo "Choice POSSIBLE_XDEBUG_VERSION: $POSSIBLE_XDEBUG_VERSION"
echo
${DIR}/dockerfiles/php-fpm/${POSSIBLE_XDEBUG_VERSION}/xdebug.sh start ${PHP_VERSION} ${WITH_PROFILER}
echo
${DIR}/dockerfiles/workspace/xdebug.sh start ${PHP_VERSION} ${WITH_PROFILER}
echo
docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_DEBUG_OR_PROFILER_MODE_ON} ${PHP_FPM_XDEBUG_EXT_PATH}"
docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_DEBUG_OR_PROFILER_MODE_ON} ${WORKSPACE_XDEBUG_EXT_PATH}"