forked from jda/docker-moodle
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Dockerfile
45 lines (35 loc) · 1.78 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Docker-Moodle
# Dockerfile for moodle instance. more dockerish version of https://github.com/sergiogomez/docker-moodle
# Forked from Jade Auer's docker version. https://github.com/jda/docker-moodle
FROM ubuntu:20.04
LABEL maintainer="Jonathan Hardison <[email protected]>"
VOLUME ["/var/moodledata"]
EXPOSE 80 443
COPY moodle-config.php /var/www/html/config.php
# Let the container know that there is no tty
ENV DEBIAN_FRONTEND noninteractive
# Database info and other connection information derrived from env variables. See readme.
# Set ENV Variables externally Moodle_URL should be overridden.
ENV MOODLE_URL http://127.0.0.1
# Enable when using external SSL reverse proxy
# Default: false
ENV SSL_PROXY false
COPY ./foreground.sh /etc/apache2/foreground.sh
RUN apt-get update && apt-get upgrade -y && \
apt-get -y install mysql-client pwgen python-setuptools curl git unzip apache2 php \
php-gd libapache2-mod-php postfix wget supervisor php-pgsql curl libcurl4 \
libcurl3-dev php-curl php-xmlrpc php-intl php-mysql git-core php-xml php-mbstring php-zip php-soap cron php-ldap && \
cd /tmp && \
git clone -b MOODLE_400_STABLE git://git.moodle.org/moodle.git --depth=1 && \
mv /tmp/moodle/* /var/www/html/ && \
rm /var/www/html/index.html && \
chown -R www-data:www-data /var/www/html && \
chmod +x /etc/apache2/foreground.sh
#cron
COPY moodlecron /etc/cron.d/moodlecron
RUN chmod 0644 /etc/cron.d/moodlecron
# Enable SSL, moodle requires it
RUN a2enmod ssl && a2ensite default-ssl #if using proxy dont need actually secure connection
# Cleanup, this is ran to reduce the resulting size of the image.
RUN apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/lib/dpkg/* /var/lib/cache/* /var/lib/log/*
ENTRYPOINT ["/etc/apache2/foreground.sh"]