apache-php/Dockerfile

44 lines
1.3 KiB
Docker
Raw Permalink Normal View History

2023-07-08 22:23:55 +02:00
FROM php:8-apache
2020-07-17 12:42:29 +02:00
2020-07-17 23:16:35 +02:00
ENV DEBIAN_FRONTEND noninterative
# Tools
2021-08-29 11:50:22 +02:00
RUN apt-get update && apt-get install -y libxml2-utils git
2020-07-17 23:16:35 +02:00
2020-07-17 12:42:29 +02:00
# Apache Modules
2020-07-17 23:16:35 +02:00
RUN a2enmod rewrite dav dav_fs dav_lock headers
2020-07-17 12:42:29 +02:00
# Apache Config
COPY conf/zz_prod.conf /etc/apache2/conf-available
RUN a2enconf zz_prod
2020-07-17 12:42:29 +02:00
# PHP Modules
## opcache
RUN docker-php-ext-configure opcache && docker-php-ext-install -j$(nproc) opcache
## pgsql
2023-07-08 22:51:12 +02:00
RUN apt-get install -y libpq-dev && docker-php-ext-configure pgsql && docker-php-ext-install pgsql
2020-07-17 12:42:29 +02:00
2021-08-29 11:50:22 +02:00
## zip
2023-07-08 22:51:12 +02:00
RUN apt-get install -y libzip-dev && docker-php-ext-configure zip && docker-php-ext-install zip
2021-08-29 11:50:22 +02:00
# composer
RUN curl https://getcomposer.org/installer --output /tmp/composer-setup.php && php /tmp/composer-setup.php --install-dir=/tmp && mv /tmp/composer.phar /usr/local/bin/composer
2021-08-29 12:41:28 +02:00
# mysqli
RUN docker-php-ext-configure mysqli && docker-php-ext-install mysqli
2023-07-08 22:51:12 +02:00
# intl
RUN apt-get install -y libicu-dev && docker-php-ext-configure intl && docker-php-ext-install intl
# replace IP with X-Forwarded-For Header in Logs
RUN sed -i 's/^\(LogFormat .*\)%h/\1%{X-Forwarded-For}i/g' /etc/apache2/apache2.conf
2020-07-17 23:16:35 +02:00
# cleanup
2021-08-29 11:50:22 +02:00
RUN rm -rf /var/lib/apt/lists/* /tmp/composer-setup.php
2020-07-17 23:16:35 +02:00
2020-07-17 12:42:29 +02:00
# PHP ini
RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY ini/prod.ini /usr/local/etc/php/conf.d
COPY ini/opcache.ini /usr/local/etc/php/conf.d