Warning, /webapps/ocs-webserver/Dockerfile is written in an unsupported language. File is not indexed.

0001 FROM php:5-apache
0002 
0003 ENV DEBIAN_FRONTEND noninteractive
0004 
0005 ARG BUILD_ENV=production
0006 # Build-Arg BUILD_ENV may be:
0007 # "production" (default)
0008 # "development": installs XDebug
0009 
0010 # Exposes XDebug if installed
0011 EXPOSE 9000
0012 
0013 # Prepare requisites
0014 RUN apt-get update \
0015  && apt-get install -y apt-utils \
0016  && DEBIAN_FRONTEND=noninteractive \
0017     apt-get install -y build-essential \
0018     libmemcached-dev \
0019     libmcrypt-dev \
0020     zlib1g-dev \
0021     libwebp-dev \
0022     libfreetype6-dev \
0023     libjpeg62-turbo-dev \
0024     libpng-dev \
0025     libmagickwand-dev --no-install-recommends \
0026     libldap2-dev \
0027  && rm -rf /var/lib/apt/lists/* \
0028 # Memcached and APCU must be installed via pecl
0029  && yes '' | pecl install memcached-2.2.0 \
0030  && yes '' | pecl install apcu-4.0.11 \
0031  && yes '' | pecl install imagick \
0032 # MySQL, Mcrypt and Curl via the docker-specific extension-handler
0033  && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/ \
0034  && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
0035  && docker-php-ext-install gd mysql mcrypt pdo_mysql ldap \
0036  && docker-php-ext-enable memcached apcu imagick
0037 
0038 # Install Debug-extensions
0039 RUN test "$BUILD_ENV" = "development" \
0040  && yes '' | pecl install xdebug-2.5.5 \
0041  || :
0042 # Decouple installation from xdebug-configuration
0043 RUN test "$BUILD_ENV" = "development" \
0044  && echo "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so" > $PHP_INI_DIR/conf.d/xdebug.ini \
0045  && echo "[XDebug]" >> $PHP_INI_DIR/conf.d/xdebug.ini \
0046  && echo "xdebug.remote_enable = 1" >> $PHP_INI_DIR/conf.d/xdebug.ini \
0047  && echo "xdebug.remote_autostart = 1" >> $PHP_INI_DIR/conf.d/xdebug.ini \
0048  && echo "xdebug.remote_connect_back = 0" >> $PHP_INI_DIR/conf.d/xdebug.ini \
0049  && echo "xdebug.remote_log = /tmp/xdebug.log" >> $PHP_INI_DIR/conf.d/xdebug.ini \
0050  && echo "xdebug.remote_host = host.docker.internal" >> $PHP_INI_DIR/conf.d/xdebug.ini \
0051  || :
0052 
0053 # Add ocs-webserver sources
0054 COPY --chown=www-data . /usr/src/ocs-webserver
0055 WORKDIR /usr/src/ocs-webserver
0056 
0057 # Prepare file- & directory-permissions
0058 #RUN test "$BUILD_ENV" != "development" \
0059 RUN chown -vR www-data data \
0060  && chown -vR www-data httpdocs/img/cache \
0061  && chown -vR www-data httpdocs/img/data \
0062  && chown -vR www-data httpdocs/img/data \
0063  && chown -vR www-data httpdocs/partials \
0064  && chown -vR www-data httpdocs/rss \
0065  && chown -vR www-data httpdocs/template \
0066  && chown -vR www-data httpdocs/video
0067 # || :
0068 
0069 # Set new default entrypoint of Apache
0070 ENV APACHE_DOCUMENT_ROOT=/usr/src/ocs-webserver/httpdocs
0071 
0072 # Prepare apache htaccess file and mod_rewrite
0073 RUN a2enmod rewrite \
0074  && cp httpdocs/_htaccess-default httpdocs/.htaccess \
0075 # Replace the default entrypoint of Apache
0076  && sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
0077  && sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf