49 lines
1.3 KiB
Docker
49 lines
1.3 KiB
Docker
FROM php:8.4-apache
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
curl \
|
|
libpng-dev \
|
|
libonig-dev \
|
|
libxml2-dev \
|
|
libicu-dev \
|
|
zip \
|
|
unzip \
|
|
libzip-dev \
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install PHP extensions for Symfony
|
|
RUN docker-php-ext-configure intl \
|
|
&& docker-php-ext-install pdo_mysql mysqli mbstring exif pcntl bcmath gd zip intl opcache
|
|
|
|
# Configure opcache for Symfony
|
|
RUN echo "opcache.enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
|
|
&& echo "opcache.memory_consumption=256" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
|
|
&& echo "opcache.max_accelerated_files=20000" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini \
|
|
&& echo "opcache.validate_timestamps=0" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
|
|
|
|
# Enable Apache mod_rewrite
|
|
RUN a2enmod rewrite
|
|
|
|
# Enable Apache headers module
|
|
RUN a2enmod headers
|
|
|
|
# Copy custom Apache configuration
|
|
COPY ./docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
|
|
|
|
# Install Composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www/html
|
|
|
|
# Change ownership
|
|
RUN chown -R www-data:www-data /var/www/html
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Start Apache
|
|
CMD ["apache2-foreground"]
|