Compare commits

6 Commits

Author SHA1 Message Date
gavgeris 03c90eb26a Add always restart 2025-07-31 12:05:46 +03:00
gavgeris ee212c721b Add xdebug 2025-06-05 12:42:11 +03:00
gavgeris b9626c73fa php 8.1 - max input vars 2025-05-29 11:12:47 +03:00
gavgeris f097ea5980 php 8.1 - max input vars 2025-05-29 11:10:18 +03:00
gavgeris 41334b438c php 8.1 - xmlrpc 2025-05-29 11:03:10 +03:00
gavgeris 3ccb858013 php 8.1 2025-05-29 10:58:23 +03:00
4 changed files with 62 additions and 37 deletions
+50 -36
View File
@@ -1,13 +1,9 @@
FROM php:7.4-apache FROM php:8.1-apache
# Install system dependencies # Install system dependencies
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
git \ git \
unzip \ unzip \
nano \
curl \
wget \
cron \
libpng-dev \ libpng-dev \
libjpeg-dev \ libjpeg-dev \
libfreetype6-dev \ libfreetype6-dev \
@@ -21,59 +17,77 @@ RUN apt-get update && apt-get install -y \
libssl-dev \ libssl-dev \
libcurl4-openssl-dev \ libcurl4-openssl-dev \
libpq-dev \ libpq-dev \
libmagickwand-dev \ nano \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Install PHP extensions (fast method)
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions
RUN install-php-extensions \
gd \
intl \
mbstring \
xml \
xmlrpc \
soap \
zip \
pdo_mysql \
mysqli \
opcache \
xsl \
curl \ curl \
exif \ wget \
redis \ cron \
imagick libmagickwand-dev --no-install-recommends
# Enable Apache mods # Enable Apache mods
RUN a2enmod rewrite headers RUN a2enmod rewrite headers
# Install Moosh # Install PHP extensions required by Moodle
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
gd \
intl \
mbstring \
xml \
soap \
zip \
pdo \
pdo_mysql \
opcache \
mysqli \
xsl \
curl \
exif
# Download and install Moosh
RUN cd /opt && \ RUN cd /opt && \
wget https://moodle.org/plugins/download.php/33902/moosh_moodle45_2024111400.zip && \ wget https://moodle.org/plugins/download.php/33902/moosh_moodle45_2024111400.zip && \
unzip moosh_moodle45_2024111400.zip && \ unzip moosh_moodle45_2024111400.zip && \
ln -s /opt/moosh/moosh.php /usr/local/bin/moosh && \ ln -s /opt/moosh/moosh.php /usr/local/bin/moosh && \
rm moosh_moodle45_2024111400.zip rm moosh_moodle45_2024111400.zip # Clean up zip file
# PHP config
# Install Redis extension
RUN pecl install redis && \
docker-php-ext-enable redis
RUN pecl install channel://pecl.php.net/xmlrpc-1.0.0RC3 && docker-php-ext-enable xmlrpc
# Optional: Install and enable Imagick (used by Moodle for better image processing)
RUN pecl install imagick && docker-php-ext-enable imagick
# Install Xdebug
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
# Set recommended PHP configuration values for Moodle
COPY moodle-php.ini /usr/local/etc/php/conf.d/moodle-php.ini COPY moodle-php.ini /usr/local/etc/php/conf.d/moodle-php.ini
# Moodle data dir # Copy custom php.ini
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
# Create moodledata directory
RUN mkdir -p /var/www/moodledata && \ RUN mkdir -p /var/www/moodledata && \
chown -R www-data:www-data /var/www/moodledata && \ chown -R www-data:www-data /var/www/moodledata && \
chmod -R 770 /var/www/moodledata chmod -R 770 /var/www/moodledata
# Cron
# Set up Moodle cron job
COPY moodle-cron /etc/cron.d/moodle-cron COPY moodle-cron /etc/cron.d/moodle-cron
RUN chmod 0644 /etc/cron.d/moodle-cron && \ RUN chmod 0644 /etc/cron.d/moodle-cron && \
crontab /etc/cron.d/moodle-cron crontab /etc/cron.d/moodle-cron
# Startup script # Create startup script to run cron and apache
COPY start.sh /usr/local/bin/ COPY start.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/start.sh RUN chmod +x /usr/local/bin/start.sh
# Set working directory
WORKDIR /var/www/html WORKDIR /var/www/html
ENTRYPOINT ["/usr/local/bin/start.sh"] # Set entrypoint to our startup script
ENTRYPOINT ["/usr/local/bin/start.sh"]
-1
View File
@@ -48,7 +48,6 @@ services:
redis: redis:
image: 'redis:alpine' image: 'redis:alpine'
restart: always
volumes: volumes:
- ./redis_data:/data - ./redis_data:/data
healthcheck: healthcheck:
+1
View File
@@ -2,3 +2,4 @@ upload_max_filesize = 128M
post_max_size = 128M post_max_size = 128M
memory_limit = 512M memory_limit = 512M
max_execution_time = 300 max_execution_time = 300
max_input_vars = 10000
+11
View File
@@ -0,0 +1,11 @@
zend_extension=xdebug
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=172.17.80.1
xdebug.client_port=9003
xdebug.log=/tmp/xdebug.log
; Optional for development
xdebug.discover_client_host=true
xdebug.idekey=VSCODE