From c259948413083fa88ef0bb660179081fb21c19c7 Mon Sep 17 00:00:00 2001 From: George Avgeris Date: Sat, 3 May 2025 13:37:15 +0300 Subject: [PATCH] Add docker-compose.yml --- Dockerfile | 17 ++++++++++++++++- docker-compose.yml | 11 +++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index afa6abe..589cc29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,9 @@ RUN apt-get update && apt-get install -y \ libssl-dev \ libcurl4-openssl-dev \ libpq-dev \ + nano \ + curl \ + wget \ libmagickwand-dev --no-install-recommends # Enable Apache mods @@ -40,6 +43,18 @@ RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ curl \ exif +# Download and 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 # Clean up zip file + + +# Install Redis extension +RUN pecl install redis && \ + docker-php-ext-enable redis + # Optional: Install and enable Imagick (used by Moodle for better image processing) RUN pecl install imagick && docker-php-ext-enable imagick @@ -47,7 +62,7 @@ RUN pecl install imagick && docker-php-ext-enable imagick COPY moodle-php.ini /usr/local/etc/php/conf.d/moodle-php.ini # Create moodledata directory -RUN mkdir -p /var/www/moodledata && \ + chown -R www-data:www-data /var/www/moodledata && \ chmod -R 770 /var/www/moodledata # Set working directory diff --git a/docker-compose.yml b/docker-compose.yml index 3400f03..df51f1d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,3 +43,14 @@ services: interval: 5s timeout: 20s retries: 10 + + redis: + image: 'redis:alpine' + volumes: + - ./redis_data:/data + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 5s + timeout: 10s + retries: 5 + command: redis-server --appendonly yes \ No newline at end of file