# Use the official PHP image with Apache FROM php:8.1-apache # Install system dependencies RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libfreetype6-dev libzip-dev unzip git # Install PHP extensions RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install gd \ && docker-php-ext-install zip pdo pdo_mysql # Enable Apache mod_rewrite RUN a2enmod rewrite # Copy custom Apache ServerName configuration file COPY servername.conf /etc/apache2/conf-available/servername.conf RUN a2enconf servername # Update Apache to listen on port 15011 RUN sed -i 's/80/15011/g' /etc/apache2/ports.conf # Copy the Laravel application code into the container COPY . /var/www/html # Set the working directory WORKDIR /var/www/html # Install Composer (PHP dependency manager) COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Install PHP dependencies using Composer RUN composer install # Set file permissions (adjust as needed for your setup) RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache # Expose port 15011 EXPOSE 15011