Skip to content
Snippets Groups Projects
Select Git revision
  • 91495be93fe67077806470683ef1bcc14d444f02
  • master default protected
2 results

Dockerfile

Blame
  • Andrej Ramašeuski's avatar
    Andrej Ramašeuski authored
    91495be9
    History
    Dockerfile 2.36 KiB
    FROM php:7.3-apache
    LABEL maintainer="markus@martialblog.de"
    ARG version='3.27.22+211026'
    ARG sha256_checksum='b0d3e49af9d4149e136531c5209cdeede88361d78377c1509413e4264e23e594'
    
    # Install OS dependencies
    RUN set -ex; \
            apt-get update && \
            DEBIAN_FRONTEND=noninteractive \
            apt-get install --no-install-recommends -y \
            \
            libapache2-mod-auth-mellon \
            libldap2-dev \
            libfreetype6-dev \
            libjpeg-dev \
            zlib1g-dev \
            libc-client-dev \
            libkrb5-dev \
            libpng-dev \
            libzip-dev \
            libpq-dev \
            netcat \
            ssl-cert \
            \
            && apt-get -y autoclean; apt-get -y autoremove; \
            rm -rf /var/lib/apt/lists/*
    
    # Link LDAP library for PHP ldap extension
    RUN set -ex; \
            ln -fs /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/
    
    # Install PHP Plugins and Configure PHP imap plugin
    RUN set -ex; \
            docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \
            docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
            docker-php-ext-install -j5 \
            gd \
            imap \
            ldap \
            mbstring \
            pdo \
            pdo_mysql \
            pdo_pgsql \
            pgsql \
            zip
    
    ENV LIMESURVEY_VERSION=$version
    
    # Apache configuration
    RUN a2ensite default-ssl; a2enmod headers rewrite remoteip ssl; \
            {\
            echo RemoteIPHeader X-Real-IP ;\
            echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
            echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
            echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
            } > /etc/apache2/conf-available/remoteip.conf;\
            a2enconf remoteip
    
    # Use the default production configuration
    RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
    
    # Download, unzip and chmod LimeSurvey from official GitHub repository
    ADD "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" /tmp
    
    RUN set -ex; \
            echo "${sha256_checksum}  /tmp/${version}.tar.gz" | sha256sum -c - && \
            \
            tar xzvf "/tmp/${version}.tar.gz" --strip-components=1 -C /var/www/html/ && \
            rm -f "/tmp/${version}.tar.gz" && \
            chown -R www-data:www-data /var/www/html
    
    COPY entrypoint.sh entrypoint.sh
    ADD mod_auth_mellon.conf /etc/apache2/conf-enabled/mod_auth_mellon.conf
    
    EXPOSE 443
    ENTRYPOINT ["/var/www/html/entrypoint.sh"]
    CMD ["apache2-foreground"]