# Use the official PHP image with Apache 7.4 FROM php:7.4-apache LABEL Maintainer="kerstin Sieren " \ 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|||g' /etc/apache2/sites-available/000-default.conf # 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"]