-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (32 loc) · 1.5 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
# Dockerfile for moodle instance. more dockerish version of https://github.com/jda/docker-moodle
FROM ubuntu:14.04
MAINTAINER Jordi Pujol-Ahulló <[email protected]>
# Default values appear here.
# You can override them using "docker run" option like "-e MOODLE_VERSION=28"
ARG MOODLE_VERSION=30
ARG MOODLE_DATA=/var/www/moodledata
RUN echo "Moodle version: "${MOODLE_VERSION}
RUN echo "Moodle data directory:"${MOODLE_DATA}
VOLUME ["${MOODLE_DATA}"]
VOLUME ["/var/www/html"]
EXPOSE 80 443
# Let the container know that there is no tty
ENV DEBIAN_FRONTEND noninteractive
ENV MOODLE_URL $${MOODLE_URL}
ENV MOODLE_VERSION ${MOODLE_VERSION}
ENV MOODLE_DATA ${MOODLE_DATA}
RUN apt-get update && \
apt-get -y install mysql-client pwgen python-setuptools curl git unzip apache2 php5 \
php5-gd libapache2-mod-php5 postfix wget supervisor php5-pgsql curl libcurl3 \
libcurl3-dev php5-curl php5-xmlrpc php5-intl php5-mysql php5-pgsql php5-mssql git-core && \
rm -rf /var/www/html/* && \
git clone -b MOODLE_${MOODLE_VERSION}_STABLE https://github.com/moodle/moodle.git /var/www/html/ && \
mkdir -p ${MOODLE_DATA} && \
chown -R www-data:www-data /var/www/html && \
chown -R www-data:www-data ${MOODLE_DATA}
# Enable SSL, moodle requires it
# if using proxy, don't need actually secure connection
RUN a2enmod ssl && a2ensite default-ssl
RUN ln -sf /dev/stdout /var/log/apache2/access.log
RUN ln -sf /dev/stderr /var/log/apache2/error.log
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]