Opcache.ini

This commit is contained in:
2025-11-09 01:38:12 +00:00
parent 1ef9c24778
commit e71f627fd1
2 changed files with 57 additions and 46 deletions

View File

@@ -22,6 +22,12 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Habilita e configura OPcache
RUN docker-php-ext-install opcache
# Arquivo customizado de configuração do PHP com OPcache otimizado
COPY opcache.ini /usr/local/etc/php/conf.d/opcache.ini
# Define diretório de trabalho padrão # Define diretório de trabalho padrão
WORKDIR /var/www/html WORKDIR /var/www/html
@@ -33,9 +39,6 @@ RUN echo "DirectoryIndex login.php index.php" > /etc/apache2/conf-available/dire
COPY app.zip /var/www/html/ COPY app.zip /var/www/html/
RUN unzip -o app.zip -d /var/www/html && rm app.zip RUN unzip -o app.zip -d /var/www/html && rm app.zip
# Substitui o diretório /files por um link simbólico (volume externo opcional)
# RUN rm -rf /var/www/html/files && ln -s /files /var/www/html/files
# Permissões para o Apache # Permissões para o Apache
RUN chown -R www-data:www-data /var/www/html RUN chown -R www-data:www-data /var/www/html

8
opcache.ini Normal file
View File

@@ -0,0 +1,8 @@
; Habilita o OPcache
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60
opcache.validate_timestamps=1