+ xdebug into workspace & opcache into php-fpm

+ docker image inspect instructions
This commit is contained in:
2022-01-19 11:02:17 +03:00
parent 4201d657d6
commit a2fb8827c3
20 changed files with 281 additions and 107 deletions

View File

@ -78,28 +78,18 @@ ENV TZ ${TZ}
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
###########################################################################
# User Aliases
# Root Aliases
###########################################################################
USER root
COPY ./aliases.sh /root/aliases.sh
COPY ./aliases.sh /home/laradock/aliases.sh
RUN sed -i 's/\r//' /root/aliases.sh && \
sed -i 's/\r//' /home/laradock/aliases.sh && \
chown laradock:laradock /home/laradock/aliases.sh && \
echo "" >> ~/.bashrc && \
echo "# Load Custom Aliases" >> ~/.bashrc && \
echo "source ~/aliases.sh" >> ~/.bashrc && \
echo "" >> ~/.bashrc
USER laradock
RUN echo "" >> ~/.bashrc && \
echo "# Load Custom Aliases" >> ~/.bashrc && \
echo "source ~/aliases.sh" >> ~/.bashrc && \
echo "" >> ~/.bashrc
echo "" >> ~/.bashrc \
###########################################################################
# ssh:
@ -136,20 +126,6 @@ RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
;fi
###########################################################################
# PYTHON:
###########################################################################
USER root
ARG INSTALL_PYTHON=false
RUN if [ ${INSTALL_PYTHON} = true ]; then \
apt-get update && apt-get -y install python python-pip python-dev build-essential \
&& python -m pip install --upgrade "pip < 21.0" \
&& python -m pip install --upgrade virtualenv \
;fi
###########################################################################
# fswatch
###########################################################################
@ -191,6 +167,32 @@ RUN if [ ${INSTALL_S3_MINIO_CLIENT} = true ]; then \
; fi
###########################################################################
# xDebug:
###########################################################################
# Copy xdebug configuration for remote debugging
COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Load the xdebug extension only with phpunit commands
apt-get install -y php${PHP_VERSION}-xdebug && \
sed -i 's/^zend_extension=/;zend_extension=/g' /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \
;fi
###########################################################################
# BZ2:
###########################################################################
ARG INSTALL_BZ2=false
RUN if [ ${INSTALL_BZ2} = true ]; then \
apt-get install -y php${PHP_VERSION}-bz2 \
;fi
###########################################################################
# Composer:
###########################################################################
@ -252,28 +254,6 @@ RUN echo "" >> ~/.bashrc && \
RUN set -xe; php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}."
###########################################################################
# xDebug:
###########################################################################
USER root
ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Load the xdebug extension only with phpunit commands
apt-get install -y php${PHP_VERSION}-xdebug && \
sed -i 's/^;//g' /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \
;fi
# ADD for REMOTE debugging
COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
###########################################################################
# WP CLI:
###########################################################################
@ -420,6 +400,30 @@ RUN if [ ${INSTALL_YARN} = true ]; then \
# Add PATH for YARN
ENV PATH $PATH:/home/laradock/.yarn/bin
###########################################################################
# Remove DST_Root_CA3
###########################################################################
USER root
RUN sed -i 's/^mozilla\/DST_Root_CA_X3\.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf && update-ca-certificates
###########################################################################
# Tune opts:
###########################################################################
ARG PHP_OPT_MAX_EXECUTION_TIME=600
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_MEMORY_LIMIT=256M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_POST_MAX_SIZE=48M
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" /etc/php/${PHP_VERSION}/cli/php.ini
#
#--------------------------------------------------------------------------
# Final Touch