flarum-docker/Dockerfile
Raoul Snyman d97b003863
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
Change how the version is used
2024-04-24 22:46:04 -07:00

34 lines
1.6 KiB
Docker

FROM php:apache
ARG FLARUM_VERSION
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
RUN echo "$FLARUM_VERSION" > /flarum/version.txt
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"]