Atualizar Dockerfile
This commit is contained in:
32
Dockerfile
32
Dockerfile
@@ -1,32 +1,26 @@
|
|||||||
# Imagem base com PHP e Apache
|
|
||||||
FROM php:8.2-apache
|
FROM php:8.2-apache
|
||||||
|
|
||||||
# Instalar extensões PHP comuns
|
RUN set -eux; \
|
||||||
RUN apt-get update && apt-get install -y \
|
apt-get update; \
|
||||||
libzip-dev \
|
apt-get install -y --no-install-recommends \
|
||||||
unzip \
|
libzip-dev unzip libpng-dev libjpeg-dev libfreetype6-dev; \
|
||||||
libpng-dev \
|
docker-php-ext-configure gd --with-freetype --with-jpeg; \
|
||||||
libjpeg-dev \
|
docker-php-ext-install \
|
||||||
libfreetype6-dev \
|
pdo pdo_mysql mbstring zip gd; \
|
||||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
rm -rf /var/lib/apt/lists/*
|
||||||
&& docker-php-ext-install pdo pdo_mysql mbstring zip gd
|
|
||||||
|
|
||||||
# Habilitar reescrita de URL no Apache (se necessário)
|
|
||||||
RUN a2enmod rewrite
|
RUN a2enmod rewrite
|
||||||
|
|
||||||
# Instalar o Composer
|
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
# Copiar os arquivos da aplicação para o container
|
|
||||||
COPY . /var/www/html
|
COPY . /var/www/html
|
||||||
|
|
||||||
# Definir permissões apropriadas
|
RUN set -eux; \
|
||||||
RUN chown -R www-data:www-data /var/www/html \
|
chown -R www-data:www-data /var/www/html; \
|
||||||
&& chmod -R 755 /var/www/html
|
chmod -R 755 /var/www/html
|
||||||
|
|
||||||
# Instalar dependências PHP com Composer
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
|
|
||||||
|
|
||||||
# Expor a porta padrão do Apache
|
RUN set -eux; composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
Reference in New Issue
Block a user