-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
204 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,41 @@ | ||
FROM arm32v7/ubuntu | ||
FROM arm32v7/debian:stretch-slim | ||
LABEL MAINTAINER "Dashlorde <[email protected]>" | ||
LABEL MAINTAINER "Abdurrachman Mappuji <[email protected]>" | ||
LABEL MAINTAINER "dogi <[email protected]>" | ||
|
||
ENV version '3.4.0' | ||
|
||
EXPOSE 80 | ||
|
||
ADD ./start.sh /etc/apache2/start.sh | ||
ADD ./start.sh /etc/nginx/ | ||
COPY ./moodle /etc/nginx/sites-available/moodle | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install wget unzip apache2 php libapache2-mod-php7.0 php-xml php-zip \ | ||
php7.0-pgsql php7.0-curl php7.0-xmlrpc php7.0-gd php7.0-intl php7.0-mysql | ||
apt-get -y install \ | ||
nginx php-fpm php-common \ | ||
php-mbstring php-xmlrpc \ | ||
php-soap php-gd php-xml \ | ||
php-intl php-pgsql php-mysqlnd php-cli \ | ||
php-mcrypt php-ldap php-zip php-curl \ | ||
wget && \ | ||
apt-get -y autoclean && \ | ||
apt-get -y autoremove && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN wget -O /var/www/moodle-${version}.tar.gz https://github.com/moodle/moodle/archive/v${version}.tar.gz && \ | ||
RUN mkdir -p /var/www/html && \ | ||
wget -O /var/www/moodle-${version}.tar.gz \ | ||
https://github.com/moodle/moodle/archive/v${version}.tar.gz && \ | ||
rm -rf /var/www/html/ && \ | ||
cd /var/www && tar xvf moodle-${version}.tar.gz && \ | ||
rm moodle-${version}.tar.gz && \ | ||
mv /var/www/moodle-${version} /var/www/html && \ | ||
rm moodle-${version}.tar.gz && \ | ||
chown -R www-data:www-data /var/www/html && \ | ||
chmod +x /etc/apache2/start.sh &&\ | ||
chmod +x /etc/nginx/start.sh && \ | ||
mkdir -p /var/www/moodledata && chmod 777 /var/www/moodledata && \ | ||
chown -R www-data:www-data /var/www/moodledata | ||
chown -R www-data:www-data /var/www/moodledata && \ | ||
ln -s /etc/nginx/sites-available/moodle /etc/nginx/sites-enabled/ && \ | ||
unlink /etc/nginx/sites-enabled/default | ||
|
||
COPY ./config.php /var/www/html/ | ||
ADD ./config.php /var/www/html/ | ||
|
||
CMD ["/etc/apache2/start.sh"] | ||
CMD ["/etc/nginx/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
docker build . -t treehouses/moodle:rpi-pgsql | ||
docker build . -t treehouses/moodle:rpi-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
root /var/www/html; | ||
index index.php index.html index.htm; | ||
server_name _; | ||
client_max_body_size 200M; | ||
client_body_timeout 300s; | ||
|
||
location / { | ||
try_files $uri $uri/ =404; | ||
} | ||
|
||
location /dataroot/ { | ||
internal; | ||
alias /var/www/html/moodledata/; | ||
} | ||
|
||
location ~ [^/]\.php(/|$) { | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_index index.php; | ||
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | ||
include fastcgi_params; | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,50 @@ | ||
#!bin/bash | ||
|
||
source /etc/apache2/envvars | ||
# populate environment first | ||
|
||
if [ ! -z "${MOODOLE_POST_MAX_SIZE}" ] | ||
# /etc/nginx/sites-available/moodle | ||
NGINX_CONFIG="/etc/nginx/sites-available/moodle" | ||
|
||
if [ ! -z "${MOODOLE_MAX_BODY_SIZE}" ] | ||
then | ||
sed -i '/client_max_body_size/c\\tclient_max_body_size '$MOODOLE_MAX_BODY_SIZE';' $NGINX_CONFIG | ||
fi | ||
|
||
if [ ! -z "${MOODOLE_BODY_TIMEOUT}" ] | ||
then | ||
sed -i '/client_body_timeout/c\\tclient_body_timeout '$MOODOLE_BODY_TIMEOUT';' $NGINX_CONFIG | ||
fi | ||
|
||
# /etc/php/7.0/fpm/php-fpm.conf | ||
PHP_FM_CONFIG="/etc/php/7.0/fpm/php-fpm.conf" | ||
echo "[www]" >> $PHP_FM_CONFIG | ||
|
||
if [ ! -z "${MOODOLE_DB_URL}" ] | ||
then | ||
echo "env[MOODOLE_DB_URL] = '$MOODOLE_DB_URL'" >> $PHP_FM_CONFIG | ||
fi | ||
|
||
if [ ! -z "${MOODOLE_DB_NAME}" ] | ||
then | ||
echo "env[MOODOLE_DB_NAME] = '$MOODOLE_DB_NAME'" >> $PHP_FM_CONFIG | ||
fi | ||
|
||
if [ ! -z "${MOODOLE_DB_USER}" ] | ||
then | ||
sed -i '/post_max_size/c\post_max_size = '$MOODOLE_POST_MAX_SIZE /etc/php/7.0/apache2/php.ini | ||
echo "env[MOODOLE_DB_USER] = '$MOODOLE_DB_USER'" >> $PHP_FM_CONFIG | ||
fi | ||
|
||
if [ ! -z "${MOODOLE_UPLOAD_MAX_FILESIZE}" ] | ||
if [ ! -z "${MOODOLE_DB_PASS}" ] | ||
then | ||
sed -i '/upload_max_filesize/c\upload_max_filesize = '$MOODOLE_UPLOAD_MAX_FILESIZE /etc/php/7.0/apache2/php.ini | ||
echo "env[MOODOLE_DB_PASS] = '$MOODOLE_DB_PASS'" >> $PHP_FM_CONFIG | ||
fi | ||
|
||
exec apache2 -D FOREGROUND | ||
if [ ! -z "${MOODOLE_DB_PORT}" ] | ||
then | ||
echo "env[MOODOLE_DB_PORT] = '$MOODOLE_DB_PORT'" >> $PHP_FM_CONFIG | ||
fi | ||
|
||
service php7.0-fpm start | ||
service nginx start | ||
|
||
tail -f /var/log/nginx/access.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,41 @@ | ||
FROM i386/ubuntu:16.04 | ||
FROM debian:stretch-slim | ||
LABEL MAINTAINER "Dashlorde <[email protected]>" | ||
LABEL MAINTAINER "Abdurrachman Mappuji <[email protected]>" | ||
LABEL MAINTAINER "dogi <[email protected]>" | ||
|
||
ENV version '3.4.0' | ||
|
||
EXPOSE 80 | ||
|
||
ADD ./start.sh /etc/apache2/start.sh | ||
ADD ./start.sh /etc/nginx/ | ||
COPY ./moodle /etc/nginx/sites-available/moodle | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install wget unzip apache2 php libapache2-mod-php7.0 php-xml php-zip \ | ||
php7.0-mysql php7.0-curl php7.0-xmlrpc php7.0-gd php7.0-intl php7.0-pgsql | ||
apt-get -y install \ | ||
nginx php-fpm php-common \ | ||
php-mbstring php-xmlrpc \ | ||
php-soap php-gd php-xml \ | ||
php-intl php-pgsql php-mysqlnd php-cli \ | ||
php-mcrypt php-ldap php-zip php-curl \ | ||
wget && \ | ||
apt-get -y autoclean && \ | ||
apt-get -y autoremove && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN wget -O /var/www/moodle-${version}.tar.gz https://github.com/moodle/moodle/archive/v${version}.tar.gz && \ | ||
RUN mkdir -p /var/www/html && \ | ||
wget -O /var/www/moodle-${version}.tar.gz \ | ||
https://github.com/moodle/moodle/archive/v${version}.tar.gz && \ | ||
rm -rf /var/www/html/ && \ | ||
cd /var/www && tar xvf moodle-${version}.tar.gz && \ | ||
mv /var/www/moodle-${version} /var/www/html && \ | ||
rm moodle-${version}.tar.gz && \ | ||
chown -R www-data:www-data /var/www/html && \ | ||
chmod +x /etc/apache2/start.sh && \ | ||
chmod +x /etc/nginx/start.sh && \ | ||
mkdir -p /var/www/moodledata && chmod 777 /var/www/moodledata && \ | ||
chown -R www-data:www-data /var/www/moodledata | ||
chown -R www-data:www-data /var/www/moodledata && \ | ||
ln -s /etc/nginx/sites-available/moodle /etc/nginx/sites-enabled/ && \ | ||
unlink /etc/nginx/sites-enabled/default | ||
|
||
COPY ./config.php /var/www/html/ | ||
ADD ./config.php /var/www/html/ | ||
|
||
CMD ["/etc/apache2/start.sh"] | ||
CMD ["/etc/nginx/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
docker build . -t treehouses/moodle:x86-pgsql | ||
docker build . -t treehouses/moodle:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
root /var/www/html; | ||
index index.php index.html index.htm; | ||
server_name _; | ||
client_max_body_size 200M; | ||
client_body_timeout 300s; | ||
|
||
location / { | ||
try_files $uri $uri/ =404; | ||
} | ||
|
||
location /dataroot/ { | ||
internal; | ||
alias /var/www/html/moodledata/; | ||
} | ||
|
||
location ~ [^/]\.php(/|$) { | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_index index.php; | ||
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | ||
include fastcgi_params; | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,50 @@ | ||
#!bin/bash | ||
|
||
source /etc/apache2/envvars | ||
# populate environment first | ||
|
||
if [ ! -z "${MOODOLE_POST_MAX_SIZE}" ] | ||
# /etc/nginx/sites-available/moodle | ||
NGINX_CONFIG="/etc/nginx/sites-available/moodle" | ||
|
||
if [ ! -z "${MOODOLE_MAX_BODY_SIZE}" ] | ||
then | ||
sed -i '/client_max_body_size/c\\tclient_max_body_size '$MOODOLE_MAX_BODY_SIZE';' $NGINX_CONFIG | ||
fi | ||
|
||
if [ ! -z "${MOODOLE_BODY_TIMEOUT}" ] | ||
then | ||
sed -i '/client_body_timeout/c\\tclient_body_timeout '$MOODOLE_BODY_TIMEOUT';' $NGINX_CONFIG | ||
fi | ||
|
||
# /etc/php/7.0/fpm/php-fpm.conf | ||
PHP_FM_CONFIG="/etc/php/7.0/fpm/php-fpm.conf" | ||
echo "[www]" >> $PHP_FM_CONFIG | ||
|
||
if [ ! -z "${MOODOLE_DB_URL}" ] | ||
then | ||
echo "env[MOODOLE_DB_URL] = '$MOODOLE_DB_URL'" >> $PHP_FM_CONFIG | ||
fi | ||
|
||
if [ ! -z "${MOODOLE_DB_NAME}" ] | ||
then | ||
echo "env[MOODOLE_DB_NAME] = '$MOODOLE_DB_NAME'" >> $PHP_FM_CONFIG | ||
fi | ||
|
||
if [ ! -z "${MOODOLE_DB_USER}" ] | ||
then | ||
sed -i '/post_max_size/c\post_max_size = '$MOODOLE_POST_MAX_SIZE /etc/php/7.0/apache2/php.ini | ||
echo "env[MOODOLE_DB_USER] = '$MOODOLE_DB_USER'" >> $PHP_FM_CONFIG | ||
fi | ||
|
||
if [ ! -z "${MOODOLE_UPLOAD_MAX_FILESIZE}" ] | ||
if [ ! -z "${MOODOLE_DB_PASS}" ] | ||
then | ||
sed -i '/upload_max_filesize/c\upload_max_filesize = '$MOODOLE_UPLOAD_MAX_FILESIZE /etc/php/7.0/apache2/php.ini | ||
echo "env[MOODOLE_DB_PASS] = '$MOODOLE_DB_PASS'" >> $PHP_FM_CONFIG | ||
fi | ||
|
||
exec apache2 -D FOREGROUND | ||
if [ ! -z "${MOODOLE_DB_PORT}" ] | ||
then | ||
echo "env[MOODOLE_DB_PORT] = '$MOODOLE_DB_PORT'" >> $PHP_FM_CONFIG | ||
fi | ||
|
||
service php7.0-fpm start | ||
service nginx start | ||
|
||
tail -f /var/log/nginx/access.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters