diff --git a/asystgrade/db/access.php b/asystgrade/db/access.php deleted file mode 100755 index fbb0f7bef233360a80300067f1d8e0252fbb3e92..0000000000000000000000000000000000000000 --- a/asystgrade/db/access.php +++ /dev/null @@ -1,4 +0,0 @@ -defined('MOODLE_INTERNAL') || die(); - -$capabilities = array( -); \ No newline at end of file diff --git a/asystgrade/db/install.xml b/asystgrade/db/install.xml deleted file mode 100755 index 16dcbb9c48fe12a6993185c589056a4f935319ff..0000000000000000000000000000000000000000 --- a/asystgrade/db/install.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<XMLDB PATH="local/asystgrade/db" VERSION="2024032201" COMMENT="XMLDB file for mod asystgrade plugin" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd" -> - <TABLES> - <TABLE NAME="local_asystgrade" COMMENT="Table for storing asystgrade data"> - <FIELDS> - <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true"/> - <FIELD NAME="question" TYPE="text" NOTNULL="true"/> - <FIELD NAME="referenceanswer" TYPE="text" NOTNULL="true"/> - <FIELD NAME="studentanswer" TYPE="text" NOTNULL="true"/> - <FIELD NAME="observed_grade" TYPE="int" LENGTH="3" NOTNULL="true"/> - <FIELD NAME="studentid" TYPE="int" LENGTH="10" NOTNULL="false"/> - <FIELD NAME="recordid" TYPE="int" LENGTH="10" NOTNULL="false"/> - </FIELDS> - <KEYS> - <KEY NAME="primary" TYPE="primary" FIELDS="id"/> - </KEYS> - </TABLE> - </TABLES> -</XMLDB> diff --git a/docker-compose.yml b/docker-compose.yml index fdc50d34e3bdebaa4015361e209a3a72d48c066e..f06e28d625e1f903253beb2f7c32a5fbbdb1e9de 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,7 @@ services: - ./.env restart: always build: # Building own Moodle container from Dockerfile. - context: . # The context of the build (where is Dockerfile) + context: ./moodle # The context of the build (where is Dockerfile) dockerfile: Dockerfile args: - MOODLE_BASE_DIR=${MOODLE_BASE_DIR} @@ -50,7 +50,7 @@ services: flask: build: - context: ./flask # Папка Ñ Dockerfile Ð´Ð»Ñ Flask + context: ./flask # The context of the Flask build (where is Dockerfile) dockerfile: Dockerfile env_file: - ./.env diff --git a/install_moodle.sh b/install_moodle.sh index 3d898c6c1ba7735a97b77f06aba3b3282114b418..0f68f2f81e368b8def490aad82f49a093185e3ad 100755 --- a/install_moodle.sh +++ b/install_moodle.sh @@ -36,12 +36,12 @@ docker-compose exec moodle php ${MOODLE_BASE_DIR}/admin/cli/install.php \ --non-interactive # Check if database backup exists and restore it if it does - BACKUP_FILE="moodle_backup.sql" + BACKUP_FILE="moodle/moodle_backup.sql" if [ -f "$BACKUP_FILE" ]; then # docker-compose exec mariadb apt-get update && apt-get install -y mysql-client && rm -rf /var/lib/apt/lists/* docker-compose exec mariadb bash -c "apt-get update && apt-get install -y mysql-client && rm -rf /var/lib/apt/lists/*" echo "Database backup found. Restoring..." - docker-compose exec -T mariadb mysql -u ${MOODLE_DATABASE_USER} -p${MOODLE_DATABASE_PASSWORD} ${MOODLE_DATABASE_NAME} < moodle_backup.sql + docker-compose exec -T mariadb mysql -u ${MOODLE_DATABASE_USER} -p${MOODLE_DATABASE_PASSWORD} ${MOODLE_DATABASE_NAME} < moodle/moodle_backup.sql echo "Database restored from backup." else echo "No database backup found. Skipping restore." diff --git a/Dockerfile b/moodle/Dockerfile old mode 100755 new mode 100644 similarity index 82% rename from Dockerfile rename to moodle/Dockerfile index 408b6a4a7130db0da92efdf4722f65d96d732cb9..e80c7213d8649eedf8e372d6bc6c4b223956c36c --- a/Dockerfile +++ b/moodle/Dockerfile @@ -21,30 +21,24 @@ RUN apt-get update && apt-get upgrade -y && \ apt-get clean && rm -rf /var/lib/apt/lists/* # Setting necessary php params -#RUN echo "mysql.default_socket=/run/mysqld/mysqld.sock" >> /etc/php/8.2/cli/php.ini RUN echo "mysql.default_socket=/run/mysqld/mysqld.sock" >> /etc/php/8.2/apache2/php.ini RUN echo "max_input_vars = 5000" >> /etc/php/8.2/apache2/php.ini RUN echo "max_input_vars = 5000" >> /etc/php/8.2/cli/php.ini # Setting Xdebug -#RUN echo "zend_extension=xdebug.so" >> /etc/php/8.2/apache2/php.ini -#RUN echo "xdebug.mode=debug" >> /etc/php/8.2/apache2/php.ini -#RUN echo "xdebug.start_with_request=yes" >> /etc/php/8.2/apache2/php.ini -#RUN echo "xdebug.client_host=host.docker.internal" >> /etc/php/8.2/apache2/php.ini -#RUN echo "xdebug.client_port=9003" >> /etc/php/8.2/apache2/php.ini +RUN echo "zend_extension=xdebug.so" >> /etc/php/8.2/apache2/php.ini +RUN echo "xdebug.mode=debug" >> /etc/php/8.2/apache2/php.ini +RUN echo "xdebug.start_with_request=yes" >> /etc/php/8.2/apache2/php.ini +RUN echo "xdebug.client_host=host.docker.internal" >> /etc/php/8.2/apache2/php.ini +RUN echo "xdebug.client_port=9003" >> /etc/php/8.2/apache2/php.ini RUN chmod 1777 /tmp -# Installing Moodle Setting correct acces rules -#RUN cd /var/www/html && mkdir -p moodle -#RUN mkdir -p ${MOODLE_BASE_DIR} RUN echo ${MOODLE_BASE_DIR} RUN mkdir -p /var/www/html/moodle WORKDIR ${MOODLE_BASE_DIR} -#RUN #mkdir -p ${MOODLE_BASE_DIR} && \ RUN wget -qO- https://packaging.moodle.org/stable403/moodle-4.3.4.tgz | tar xz -C ${MOODLE_BASE_DIR} --strip-components=1 -#RUN wget -qO- https://packaging.moodle.org/stable403/moodle-4.3.4.tgz | tar xz --strip-components=1 -C /var/www/html/moodle RUN chown -R www-data:www-data ${MOODLE_BASE_DIR} && \ @@ -55,10 +49,10 @@ RUN chown -R www-data:www-data ${MOODLE_BASE_DIR} && \ chmod -R 755 ${MOODLE_BASE_DIR_DATA} # Copying of beeing developed Plugin -COPY asystgrade ${MOODLE_BASE_DIR}/local/asystgrade +RUN echo ${MOODLE_BASE_DIR} +RUN mkdir ${MOODLE_BASE_DIR}/local/asystgrade # Setting correct acces rules for Plugin -#RUN chown -R www-data:www-data ${MOODLE_BASE_DIR}/local/asystgrade && \ RUN chmod -R 755 ${MOODLE_BASE_DIR}/local/asystgrade # Making Symlink for MariaDB Socket @@ -127,8 +121,7 @@ RUN a2enmod ssl #RUN echo "127.0.0.1 ${MOODLE_WWWROOT##https://}" >> /etc/hosts #Opening ports -#EXPOSE 80 443 5000 EXPOSE 80 443 # Running supervisord -CMD ["apache2ctl", "-D", "FOREGROUND"] +CMD ["apache2ctl", "-D", "FOREGROUND"] \ No newline at end of file diff --git a/moodle_backup.sql b/moodle/moodle_backup.sql similarity index 100% rename from moodle_backup.sql rename to moodle/moodle_backup.sql