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
9 months ago
by
Artem Baranovskyi
Browse files
Options
Download
Email Patches
Plain Diff
Few infrastructure improvements.
parent
2e30eaa7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docker-compose.yml
+1
-0
docker-compose.yml
flask/Dockerfile
+1
-3
flask/Dockerfile
install_moodle.sh
+11
-5
install_moodle.sh
moodle/Dockerfile
+4
-2
moodle/Dockerfile
with
17 additions
and
10 deletions
+17
-10
docker-compose.yml
+
1
-
0
View file @
c888fbcb
...
...
@@ -36,6 +36,7 @@ services:
ports
:
-
80:80
-
443:443
-
9003:9003
dns
:
-
8.8.8.8
-
8.8.4.4
...
...
This diff is collapsed.
Click to expand it.
flask/Dockerfile
+
1
-
3
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
...
...
This diff is collapsed.
Click to expand it.
install_moodle.sh
+
11
-
5
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"
This diff is collapsed.
Click to expand it.
moodle/Dockerfile
+
4
-
2
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
This diff is collapsed.
Click to expand it.
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