Atualizar Dockerfile
This commit is contained in:
56
Dockerfile
56
Dockerfile
@@ -1,28 +1,46 @@
|
|||||||
FROM php:8.2-apache
|
# Imagem base com PHP, Apache e extensões necessárias
|
||||||
|
FROM php:8.1-apache
|
||||||
|
|
||||||
RUN set -eux; \
|
# Configura o timezone
|
||||||
apt-get update; \
|
ENV TZ=America/Sao_Paulo
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
libzip-dev \
|
|
||||||
unzip \
|
|
||||||
libpng-dev \
|
|
||||||
libjpeg-dev \
|
|
||||||
libfreetype6-dev \
|
|
||||||
libonig-dev; \
|
|
||||||
docker-php-ext-configure gd --with-freetype --with-jpeg; \
|
|
||||||
docker-php-ext-install pdo pdo_mysql mbstring zip gd; \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
|
# Habilita módulos do Apache necessários
|
||||||
RUN a2enmod rewrite
|
RUN a2enmod rewrite
|
||||||
|
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
# Instala dependências do sistema
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
COPY . /var/www/html
|
libicu-dev \
|
||||||
|
libzip-dev \
|
||||||
RUN chown -R www-data:www-data /var/www/html && chmod -R 755 /var/www/html
|
libjpeg-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
unzip \
|
||||||
|
git \
|
||||||
|
zip \
|
||||||
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||||
|
&& docker-php-ext-install intl zip pdo pdo_mysqli mbstring gd \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
|
# Configura o diretório padrão do Apache
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
|
# Define o índice padrão do Apache
|
||||||
|
RUN echo "DirectoryIndex login.php index.php" > /etc/apache2/conf-available/directoryindex.conf && \
|
||||||
|
a2enconf directoryindex
|
||||||
|
|
||||||
|
# Copia os arquivos da aplicação empacotada
|
||||||
|
COPY app.zip /var/www/html/
|
||||||
|
RUN unzip -o app.zip && rm app.zip
|
||||||
|
|
||||||
|
# Copia e descompacta os arquivos auxiliares
|
||||||
|
#COPY files.zip /data/coolify/sgq/files/
|
||||||
|
#RUN cd /data/coolify/sgq/files && unzip -o files.zip && rm files.zip
|
||||||
|
|
||||||
|
# Ajusta permissões
|
||||||
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
|
|
||||||
|
# Expõe a porta 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
# Inicializa o Apache em foreground
|
||||||
|
CMD ["apache2-foreground"]
|
||||||
Reference in New Issue
Block a user