FROM php:8.3-apache RUN apt-get update && apt-get install -y \ git \ curl \ libicu-dev \ libzip-dev \ libonig-dev \ libssh2-1 \ libssh2-1-dev \ && rm -rf /var/lib/apt/lists/* RUN pecl install ssh2 \ && docker-php-ext-enable ssh2 \ && docker-php-ext-configure intl \ && docker-php-ext-install \ pdo \ pdo_mysql \ mysqli \ intl \ ftp \ mbstring \ bcmath \ zip RUN a2enmod rewrite COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer WORKDIR /var/www/app ENV APACHE_DOCUMENT_ROOT=/var/www/app/public RUN sed -ri \ -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' \ /etc/apache2/sites-available/*.conf \ /etc/apache2/apache2.conf \ /etc/apache2/conf-available/*.conf RUN echo '\n\ AllowOverride All\n\ Require all granted\n\ ' > /etc/apache2/conf-available/laravel.conf \ && a2enconf laravel COPY composer.json composer.lock ./ # Note: for Laravel, the COPY . . needs to be before the composer install COPY . . RUN composer install \ --no-dev \ --prefer-dist \ --no-interaction \ --optimize-autoloader RUN mkdir -p \ storage/app \ storage/framework/cache/data \ storage/framework/sessions \ storage/framework/views \ storage/logs \ bootstrap/cache \ && chown -R www-data:www-data storage bootstrap/cache \ && chmod -R ug+rwX storage bootstrap/cache EXPOSE 80