You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.7 KiB
73 lines
2.7 KiB
3 weeks ago
|
ARG VERSION=latest
|
||
|
FROM ubuntu:${VERSION}
|
||
|
|
||
|
# Сведения о контейнере
|
||
|
LABEL author="esoe"
|
||
|
LABEL description="moodle image for exam"
|
||
|
LABEL version="1.0"
|
||
|
|
||
|
# VOLUME ["/var/moodledata", "/var/www/html"]
|
||
|
# EXPOSE 80 443
|
||
|
|
||
|
# Let the container know that there is no tty
|
||
|
# ENV DEBIAN_FRONTEND noninteractive
|
||
|
|
||
|
# This should be overridden on running moodle container
|
||
|
ENV MOODLE_URL http://moodle:80
|
||
|
# ENV MOODLE_URL http://192.168.99.100:8080
|
||
|
|
||
|
COPY ./foreground-apache2.sh /etc/apache2/foreground.sh
|
||
|
|
||
|
# обновление пакетов
|
||
|
RUN apt-get update -y
|
||
|
RUN apt-get -u upgrade -y
|
||
|
|
||
|
# установка пакетов, необходимых для развертывания и работы moodle
|
||
|
RUN apt-get install pwgen -y
|
||
|
RUN apt-get install curl -y
|
||
|
RUN apt-get install git -y
|
||
|
RUN apt-get install unzip -y
|
||
|
RUN apt-get install vim -y
|
||
|
RUN apt-get install wget -y
|
||
|
RUN apt-get install postgresql-client -y
|
||
|
RUN apt-get install software-properties-common -y
|
||
|
|
||
|
# установка php 8.1
|
||
|
RUN add-apt-repository ppa:ondrej/php
|
||
|
RUN apt-get update
|
||
|
RUN apt-get install php8.1 -y
|
||
|
RUN apt-get install libapache2-mod-php8.1 -y
|
||
|
RUN apt-get install php8.1-fpm php8.1-curl php8.1-gd php8.1-xmlrpc php8.1-intl php8.1-xml php8.1-zip php8.1-mbstring php8.1-soap php8.1-pgsql -y
|
||
|
## настройка php
|
||
|
RUN echo "max_input_vars=5000" >> /etc/php/8.1/cli/php.ini
|
||
|
|
||
|
# установка apache2
|
||
|
RUN apt-get install apache2 -y
|
||
|
## дописываем в конец apache2.conf новый параметр
|
||
|
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||
|
RUN echo "max_input_vars=5000" >> /etc/php/8.1/apache2/php.ini
|
||
|
|
||
|
# подготовка пакета moodle
|
||
|
RUN echo "содержимое /var/www/html:"
|
||
|
## проверка содержимого /var/www/html
|
||
|
RUN ls --recursive /var/www/html
|
||
|
## очистить директорию /var/www/html перед скачиванием moodle
|
||
|
RUN rm -rf /var/www/html/*
|
||
|
## клонировать moodle
|
||
|
# RUN git clone -b MOODLE_405_STABLE https://git.in.moodle.com/moodle/moodle.git /var/www/html
|
||
|
COPY ./distro/moodle /var/www/html
|
||
|
## устанавливаем владельцем директории пользователя www-data
|
||
|
RUN chown -R www-data:www-data /var/www/html
|
||
|
|
||
|
# Enable SSL, moodle requires it
|
||
|
## if using proxy, don't need actually secure connection
|
||
|
RUN a2enmod ssl && a2ensite default-ssl
|
||
|
|
||
|
# запуск apache2
|
||
|
## право на исполнение скрипта запуска apache2
|
||
|
RUN chmod +x /etc/apache2/foreground.sh
|
||
|
## запуск apache2
|
||
|
CMD ["bash","/etc/apache2/foreground.sh"]
|
||
|
|
||
|
# далее:
|
||
|
# в ручную запускаем скрипт инсталяции moodle .\install
|