FROM php:7.4-apache AS php-base # Set Apache document root ENV APACHE_DOCUMENT_ROOT /app/public RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf # Use the default production configuration RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" # Dependencies RUN apt-get update -y && apt-get install -y ssh libpng-dev libkrb5-dev libmagickwand-dev libjpeg-dev libmemcached-dev zlib1g-dev libzip-dev git unzip subversion ca-certificates libicu-dev libxml2-dev libmcrypt-dev libc-client-dev && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/ # PHP Extensions - PECL RUN pecl install imagick-3.4.4 memcached mcrypt-1.0.4 && docker-php-ext-enable imagick memcached mcrypt # PHP Extensions - configure imap RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl # PHP Extensions - docker-php-ext-install RUN docker-php-ext-install zip gd mysqli exif pdo pdo_mysql opcache intl imap # PHP Extensions - docker-php-ext-configure RUN docker-php-ext-configure intl # PHP Tools RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php --install-dir=/usr/local/bin --filename=composer # Config RUN a2enmod rewrite # Override default config with custom PHP settings COPY config/* $PHP_INI_DIR/conf.d/ # Rewrite port RUN sed -ri -e 's/80/8080/g' /etc/apache2/ports.conf RUN sed -ri -e 's/80/8080/g' /etc/apache2/sites-available/*.conf RUN sed -ri -e 's/80/8080/g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf # Use www-data RUN mkdir /app RUN chown www-data:www-data /app ENV XDG_CONFIG_HOME=/app FROM php-base AS php USER www-data WORKDIR /app # Install freescout ENV FREESCOUT_COMMIT=dd2e262c511b4f80fb92b40bae30c168d55f24fb RUN git clone -b add-s3-support https://github.com/veebkolm/freescout.git /app RUN git checkout $FREESCOUT_COMMIT # Install oauth plugin COPY modules/OAuth /app/Modules/OAuth # Create necessary symlink RUN php artisan storage:link RUN touch /app/storage/logs/laravel.log COPY entrypoint.sh /entrypoint.sh CMD ["/bin/bash"] ENTRYPOINT ["/entrypoint.sh"] EXPOSE 8080