diff --git a/Dockerfile b/Dockerfile index 6efd2c2..dba3793 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,35 @@ FROM php:8.2-apache -# Apache modüllerini aktif et +# Modülleri aktif et RUN a2enmod rewrite expires deflate headers -# .htaccess dosyalarının çalışması için AllowOverride izni ver -RUN sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf +# Apache Site Konfigürasyonunu doğrudan güncelle (Header ve Önbellek zorlaması) +RUN echo '\n\ + DocumentRoot /var/www/html\n\ + \n\ + AllowOverride All\n\ + Require all granted\n\ + \n\ + # Gzip ve Cache ayarları\n\ + \n\ + ExpiresActive On\n\ + ExpiresDefault "access plus 1 month"\n\ + ExpiresByType image/jpg "access plus 1 year"\n\ + ExpiresByType image/jpeg "access plus 1 year"\n\ + ExpiresByType image/png "access plus 1 year"\n\ + ExpiresByType image/webp "access plus 1 year"\n\ + ExpiresByType font/woff2 "access plus 1 year"\n\ + ExpiresByType text/css "access plus 1 month"\n\ + ExpiresByType application/javascript "access plus 1 month"\n\ + \n\ + \n\ + Header set Cache-Control "max-age=31536000, public"\n\ + \n\ +' > /etc/apache2/sites-available/000-default.conf # Proje dosyalarını kopyala COPY . /var/www/html/ - -# İzinleri ayarla RUN chown -R www-data:www-data /var/www/html/ WORKDIR /var/www/html - EXPOSE 80