| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- # Use the official PHP image with Apache 7.4
- FROM php:7.4-apache
- LABEL Maintainer="kerstin Sieren <kerstin@sieren.biz>" \
- Description="Lightweight container with Apache & PHP-FPM based on Debian Buster."
- # Install required system packages and PHP extensions
- RUN apt-get update && apt-get install -y \
- libzip-dev \
- libfreetype6-dev \
- libjpeg62-turbo-dev \
- libpng-dev \
- libonig-dev \
- libxml2-dev \
- libssl-dev \
- libxslt1-dev \
- libicu-dev \
- libpq-dev \
- wget \
- unzip \
- git \
- && docker-php-ext-configure gd --with-freetype --with-jpeg \
- && docker-php-ext-install -j$(nproc) gd \
- && docker-php-ext-install mysqli pdo pdo_mysql mbstring zip xml opcache soap intl xsl
- # Install the MongoDB extension
- RUN pecl install mongodb \
- && docker-php-ext-enable mongodb
- # Configure PHP
- RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
- && echo 'always_populate_raw_post_data = -1\nmax_execution_time = 240\nmax_input_vars = 1500\nupload_max_filesize = 32M\npost_max_size = 32M' > $PHP_INI_DIR/conf.d/typo3.ini
- # Enable Apache modules
- RUN a2enmod proxy_fcgi setenvif rewrite
- # Modify the document root in 000-default.conf
- RUN sed -i 's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|g' /etc/apache2/sites-available/000-default.conf \
- && sed -i 's|<Directory /var/www/html>|<Directory /var/www/html/public>|g' /etc/apache2/sites-available/000-default.conf
- # Set ServerName directive
- RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
- # Grant Apache permission to bind to ports 80 and 443
- RUN apt-get install -y libcap2-bin \
- && setcap 'cap_net_bind_service=+ep' /usr/sbin/apache2
- # Install Composer
- RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- # Expose HTTP and HTTPS ports
- EXPOSE 80 443
- # Set the working directory
- WORKDIR /var/www/html
- # Start Apache in the foreground
- CMD ["apache2-foreground"]
|