Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.11.26 #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions 000-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/chamilo2/public
DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
Expand All @@ -26,11 +27,30 @@
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

<Directory /var/www/html/chamilo2/public>

<Directory />
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>

php_value max_execution_time 300
php_value max_input_time 600
php_value memory_limit 256M
php_value post_max_size 100M
php_value upload_max_filesize 100M
php_value short_open_tag 0
php_value safe_mode 0
php_value magic_quotes_gpc 0
php_value magic_quotes_runtime 0
php_value display_errors On
php_value session.cookie_httponly 1
php_value output_buffering 1
php_value variables_order GPCS

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
103 changes: 45 additions & 58 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,61 +1,48 @@
FROM ubuntu:14.04
MAINTAINER Yannick Warnier <[email protected]>

# Keep upstart from complaining
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -sf /bin/true /sbin/initctl

# Update Ubuntu and install basic PHP stuff
RUN apt-get -y update && apt-get install -y \
curl \
git \
libapache2-mod-php5 \
php5-cli \
php5-curl \
php5-gd \
php5-intl \
php5-mysql \
wget

RUN apt-get install -y openssh-server
RUN mkdir -p /var/run/sshd

# Get Chamilo
RUN mkdir -p /var/www/chamilo
ADD https://github.com/chamilo/chamilo-lms/archive/v1.10.0-alpha.tar.gz /var/www/chamilo/chamilo.tar.gz
WORKDIR /var/www/chamilo
RUN tar zxf chamilo.tar.gz;rm chamilo.tar.gz;mv chamilo* www
WORKDIR www
RUN chown -R www-data:www-data \
app \
main/default_course_document/images \
main/lang \
vendor \
web

# Get Composer (putting the download in /root is discutible)
WORKDIR /root
RUN curl -sS https://getcomposer.org/installer | php
RUN chmod +x composer.phar
RUN mv composer.phar /usr/local/bin/composer

# Get Chash
RUN git clone https://github.com/chamilo/chash.git chash
WORKDIR chash
RUN composer update --no-dev
RUN php -d phar.readonly=0 createPhar.php
RUN chmod +x chash.phar && mv chash.phar /usr/local/bin/chash

# Configure and start Apache
ADD chamilo.conf /etc/apache2/sites-available/chamilo.conf
RUN a2ensite chamilo
FROM php:7.4-apache

LABEL maintainer="Chamilo <[email protected]>"

# Install required system packages
RUN apt-get update && apt-get install -y \
git \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libzip-dev \
libicu-dev \
libxslt-dev \
libldap2-dev \
unzip \
build-essential \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-install -j$(nproc) intl \
&& docker-php-ext-install -j$(nproc) pdo_mysql \
&& docker-php-ext-install -j$(nproc) zip \
&& docker-php-ext-install -j$(nproc) xsl \
&& docker-php-ext-install -j$(nproc) opcache \
&& docker-php-ext-install -j$(nproc) bcmath \
&& docker-php-ext-install -j$(nproc) ldap \
&& apt-get autoremove -y \
&& apt-get clean

# Enable Apache mod_rewrite
RUN a2enmod rewrite
RUN /etc/init.d/apache2 restart
RUN echo "127.0.0.1 docker.chamilo.net" >> /etc/hosts

# Go to Chamilo folder and install
# Soon... (this involves having a SQL server in a linked container)
# Set the Chamilo version
ENV CHAMILO_VERSION=1.11.26

# Download Chamilo
RUN curl -SL "https://github.com/chamilo/chamilo-lms/releases/download/v${CHAMILO_VERSION}/chamilo-${CHAMILO_VERSION}.tar.gz" -o chamilo.tar.gz \
&& tar -xzf chamilo.tar.gz -C /var/www/html --strip-components=1 \
&& rm chamilo.tar.gz \
&& chown -R www-data:www-data /var/www/html \
&& chmod -R go=u,go-w /var/www/html

# Copy the configuration file
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf

# Expose port 80 for Apache
EXPOSE 80

WORKDIR /var/www/chamilo/www
EXPOSE 22 80
CMD ["/bin/bash"]