Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pado
Asyst Moodle Plugin
Commits
c888fbcb
Commit
c888fbcb
authored
Sep 19, 2024
by
Artem Baranovskyi
Browse files
Few infrastructure improvements.
parent
2e30eaa7
Changes
4
Hide whitespace changes
Inline
Side-by-side
docker-compose.yml
View file @
c888fbcb
...
...
@@ -36,6 +36,7 @@ services:
ports
:
-
80:80
-
443:443
-
9003:9003
dns
:
-
8.8.8.8
-
8.8.4.4
...
...
flask/Dockerfile
View file @
c888fbcb
...
...
@@ -11,15 +11,13 @@ RUN python3 -m venv /opt/myenv
ENV
PATH="/opt/myenv/bin:$PATH"
WORKDIR
/app
RUN
ls
-la
/app
COPY
. /app
COPY
./asyst /app/asyst
# Installing dependencies
RUN
/opt/myenv/bin/pip
install
--no-cache-dir
-i
https://pypi.tuna.tsinghua.edu.cn/simple
-r
/app/requirements.txt
#RUN /opt/myenv/bin/python3 -m pip install -r /app/requirements.txt
RUN
/opt/myenv/bin/python3
-m
pip
install
--upgrade
setuptools wheel
COPY
./asyst /app/asyst
# Set permissions
RUN
chown
-R
www-data:www-data /app/asyst
...
...
install_moodle.sh
View file @
c888fbcb
...
...
@@ -54,10 +54,14 @@ docker-compose exec -u root moodle bash -c "apt-get update && apt-get install -y
update-locale"
# Composer installation to run phpunit tests
docker-compose
exec
moodle php
-r
"copy('https://getcomposer.org/installer', 'composer-setup.php');"
docker-compose
exec
moodle php composer-setup.php
--install-dir
=
/usr/local/bin
--filename
=
composer
docker-compose
exec
moodle php
-r
"unlink('composer-setup.php');"
docker-compose
exec
moodle bash
-c
"cd /app && /usr/local/bin/composer install --no-interaction --no-plugins --no-scripts --no-dev --prefer-dist && /usr/local/bin/composer dump-autoload"
docker-compose
exec
moodle bash
-c
"
php -r
\"
copy('https://getcomposer.org/installer', 'composer-setup.php');
\"
&&
php composer-setup.php --install-dir=/usr/local/bin --filename=composer &&
php -r
\"
unlink('composer-setup.php');
\"
&&
cd /app &&
/usr/local/bin/composer install --no-interaction --no-plugins --no-scripts --no-dev --prefer-dist &&
/usr/local/bin/composer dump-autoload
"
# Next, configure PHPUnit for Moodle:
docker-compose
exec
moodle php admin/tool/phpunit/cli/init.php
...
...
@@ -80,7 +84,9 @@ cd /app/asyst/Source/Skript/german
/opt/myenv/bin/python3 /app/api.py
EOF'
# Make the script executable & run it
docker-compose
exec
flask
chmod
+x /usr/local/bin/run_sag
docker-compose
exec
flask /usr/local/bin/run_sag
# Adding cron-record at the Moodle container
docker-compose
exec
-u
root moodle bash
-c
"echo '* * * * * /usr/bin/php
${
MOODLE_BASE_DIR
}
/admin/cli/cron.php >/dev/null 2>&1' >> /etc/crontabs/root && crontab /etc/crontabs/root"
moodle/Dockerfile
View file @
c888fbcb
...
...
@@ -29,8 +29,10 @@ RUN echo "max_input_vars = 5000" >> /etc/php/8.2/cli/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_host=host.docker.internal" >> /etc/php/8.2/apache2/php.ini
RUN
echo
"xdebug.client_host=127.0.0.1"
>>
/etc/php/8.2/apache2/php.ini
RUN
echo
"xdebug.client_port=9003"
>>
/etc/php/8.2/apache2/php.ini
RUN
echo
"xdebug.log=/tmp/xdebug.log"
>>
/etc/php/8.2/apache2/php.ini
RUN
chmod
1777 /tmp
...
...
@@ -123,5 +125,5 @@ RUN a2enmod ssl
#Opening ports
EXPOSE
80 443
#
Running supervisor
d
#
Launch Apache server in foregroun
d
CMD
["apache2ctl", "-D", "FOREGROUND"]
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment