Atualizar Dockerfile
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -1,24 +1,35 @@
|
|||||||
FROM php:8.1-apache
|
FROM php:8.1-apache
|
||||||
|
|
||||||
ENV TZ=America/Sao_Paulo
|
ENV TZ=America/Sao_Paulo
|
||||||
|
|
||||||
|
# Instala utilitários necessários
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
unzip git zip && \
|
unzip git zip && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Copia o instalador automático de extensões PHP
|
||||||
COPY --from=mlocati/php-extension-installer:latest \
|
COPY --from=mlocati/php-extension-installer:latest \
|
||||||
/usr/bin/install-php-extensions /usr/local/bin/
|
/usr/bin/install-php-extensions /usr/local/bin/
|
||||||
|
|
||||||
|
# Habilita o módulo rewrite do Apache e instala extensões PHP
|
||||||
RUN a2enmod rewrite && \
|
RUN a2enmod rewrite && \
|
||||||
install-php-extensions gd intl pdo_mysql zip
|
install-php-extensions gd intl pdo_mysql mysqli zip mbstring
|
||||||
|
|
||||||
|
# Define o diretório de trabalho
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
# Configura o índice padrão do Apache
|
||||||
RUN echo "DirectoryIndex login.php index.php" \
|
RUN echo "DirectoryIndex login.php index.php" \
|
||||||
> /etc/apache2/conf-available/directoryindex.conf && \
|
> /etc/apache2/conf-available/directoryindex.conf && \
|
||||||
a2enconf directoryindex
|
a2enconf directoryindex
|
||||||
|
|
||||||
|
# Copia e descompacta a aplicação
|
||||||
COPY app.zip /var/www/html/
|
COPY app.zip /var/www/html/
|
||||||
RUN unzip -o app.zip && rm app.zip
|
RUN unzip -o app.zip && rm app.zip
|
||||||
|
|
||||||
|
# Ajusta permissões
|
||||||
RUN chown -R www-data:www-data /var/www/html
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["apache2-foreground"]
|
CMD ["apache2-foreground"]
|
||||||
|
|||||||
Reference in New Issue
Block a user