Commit c888fbcb authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Few infrastructure improvements.

parent 2e30eaa7
......@@ -36,6 +36,7 @@ services:
ports:
- 80:80
- 443:443
- 9003:9003
dns:
- 8.8.8.8
- 8.8.4.4
......
......@@ -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
......
......@@ -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"
......@@ -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 supervisord
# Launch Apache server in foreground
CMD ["apache2ctl", "-D", "FOREGROUND"]
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment