79 lines
1.7 KiB
Docker
79 lines
1.7 KiB
Docker
FROM php:7.4-apache
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
unzip \
|
|
nano \
|
|
curl \
|
|
wget \
|
|
cron \
|
|
libpng-dev \
|
|
libjpeg-dev \
|
|
libfreetype6-dev \
|
|
libxml2-dev \
|
|
libzip-dev \
|
|
libonig-dev \
|
|
libicu-dev \
|
|
libxslt-dev \
|
|
libmcrypt-dev \
|
|
zlib1g-dev \
|
|
libssl-dev \
|
|
libcurl4-openssl-dev \
|
|
libpq-dev \
|
|
libmagickwand-dev \
|
|
--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 \
|
|
exif \
|
|
redis \
|
|
imagick
|
|
|
|
# Enable Apache mods
|
|
RUN a2enmod rewrite headers
|
|
|
|
# Install Moosh
|
|
RUN cd /opt && \
|
|
wget https://moodle.org/plugins/download.php/33902/moosh_moodle45_2024111400.zip && \
|
|
unzip moosh_moodle45_2024111400.zip && \
|
|
ln -s /opt/moosh/moosh.php /usr/local/bin/moosh && \
|
|
rm moosh_moodle45_2024111400.zip
|
|
|
|
# PHP config
|
|
COPY moodle-php.ini /usr/local/etc/php/conf.d/moodle-php.ini
|
|
|
|
# Moodle data dir
|
|
RUN mkdir -p /var/www/moodledata && \
|
|
chown -R www-data:www-data /var/www/moodledata && \
|
|
chmod -R 770 /var/www/moodledata
|
|
|
|
# Cron
|
|
COPY moodle-cron /etc/cron.d/moodle-cron
|
|
RUN chmod 0644 /etc/cron.d/moodle-cron && \
|
|
crontab /etc/cron.d/moodle-cron
|
|
|
|
# Startup script
|
|
COPY start.sh /usr/local/bin/
|
|
RUN chmod +x /usr/local/bin/start.sh
|
|
|
|
WORKDIR /var/www/html
|
|
|
|
ENTRYPOINT ["/usr/local/bin/start.sh"] |