2023-08-05 17:42:27 +00:00
|
|
|
FROM php:apache
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-10-19 04:46:59 +00:00
|
|
|
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
|
2023-08-05 17:42:27 +00:00
|
|
|
RUN apt-get update \
|
2023-10-19 04:46:59 +00:00
|
|
|
&& 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 \
|
2023-08-05 17:42:27 +00:00
|
|
|
&& pecl install yaml \
|
|
|
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
|
|
&& docker-php-ext-configure pgsql --with-pgsql=/usr/local/pgsql \
|
2023-10-24 23:15:23 +00:00
|
|
|
&& 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 \
|
2023-08-05 17:42:27 +00:00
|
|
|
&& 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
|
2023-10-19 04:46:59 +00:00
|
|
|
RUN composer create-project flarum/flarum /flarum/app
|
|
|
|
RUN chown -R www-data:www-data /flarum
|
2023-08-05 17:42:27 +00:00
|
|
|
|
|
|
|
VOLUME /flarum/app/extensions /flarum/app/public/assets /flarum/app/storage/logs
|
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
|
|
|
CMD ["apache2-foreground"]
|