FROM php:apache ARG FLARUM_VERSION=1.8.5 WORKDIR /flarum/app ENV APACHE_DOCUMENT_ROOT /flarum/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 RUN sed -ri -e 's!AllowOverride [Nn]one!AllowOverride All!' /etc/apache2/sites-available/*.conf RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" RUN a2enmod rewrite COPY --from=composer /usr/bin/composer /usr/local/bin/composer RUN apt-get update \ && apt-get install -y gettext git libfreetype-dev libjpeg62-turbo-dev libpng-dev libpq5 libpq-dev mariadb-client libyaml-0-2 libyaml-dev p7zip unzip zip \ && pecl install yaml \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-configure pgsql --with-pgsql=/usr/local/pgsql \ && docker-php-ext-install -j$(nproc) gd pdo pdo_mysql pdo_pgsql pgsql exif \ && docker-php-ext-enable gd pdo pdo_mysql pdo_pgsql pgsql yaml exif \ && apt-get autoremove --purge -y libpq-dev libyaml-dev \ && apt-get clean COPY docker/make_config.php /flarum/make_config.php COPY docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh RUN chmod a+x /usr/local/bin/docker-entrypoint.sh RUN composer create-project flarum/flarum /flarum/app "$FLARUM_VERSION" RUN chown -R www-data:www-data /flarum VOLUME /flarum/app/extensions /flarum/app/public/assets /flarum/app/storage/logs ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] CMD ["apache2-foreground"]