From f51097e3ab46a9f3825d3e8634b4a97eb31728e6 Mon Sep 17 00:00:00 2001 From: Kenio Date: Thu, 3 Jul 2025 13:46:21 -0300 Subject: [PATCH] feat: Otimiza Dockerfile para PHP/Apache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adiciona mbstring e opcache. - Refina permissões de arquivos e diretórios. --- Dockerfile | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 12f2256..a7cdba6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,18 +5,7 @@ FROM php:8.4-apache RUN apt-get update && apt-get install -y \ libpng-dev \ libjpeg-dev \ - libonig-dev \ - libxml2-dev \ - zip \ - unzip \ - curl \ - git \ - libzip-dev \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) gd \ - && docker-php-ext-install pdo pdo_mysql mysqli zip + libonig-dev libxml2-dev zip unzip curl git libzip-dev libfreetype6-dev libjpeg62-turbo-dev && docker-php-ext-configure gd --with-freetype --with-jpeg && docker-php-ext-install -j$(nproc) gd mbstring && docker-php-ext-install pdo pdo_mysql mysqli zip && docker-php-ext-enable opcache # Habilita o módulo de reescrita do Apache (útil para Laravel ou outros frameworks) @@ -32,8 +21,7 @@ COPY ./apache/000-default.conf /etc/apache2/sites-available/000-default.conf COPY . /var/www/html/ # Define permissões apropriadas -RUN chown -R www-data:www-data /var/www/html \ - && chmod -R 755 /var/www/html +RUN chown -R www-data:www-data /var/www/html && find /var/www/html -type d -exec chmod 755 {} + && find /var/www/html -type f -exec chmod 644 {} + # Define o diretório de trabalho WORKDIR /var/www/html