-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·47 lines (37 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM php:8.1-apache
# Instalar dependências
RUN apt-get update && apt-get install -y \
libicu-dev \
zip \
unzip
# Instalar extensões PHP necessárias
RUN docker-php-ext-install \
intl \
pdo_mysql \
mysqli
# Habilitar mod_rewrite do Apache
RUN a2enmod rewrite
# Configurar diretório de trabalho
WORKDIR /var/www/html
# Copiar arquivos do projeto
COPY . /var/www/html/
# Criar arquivo de configuração do Apache
RUN echo '<VirtualHost *:80>\n\
DocumentRoot /var/www/html/public\n\
DirectoryIndex index.php\n\
<Directory /var/www/html/public>\n\
AllowOverride All\n\
Require all granted\n\
</Directory>\n\
</VirtualHost>' > /etc/apache2/sites-available/000-default.conf
# Configurar permissões (atualizado)
RUN chown -R www-data:www-data /var/www/html \
&& find /var/www/html/writable -type d -exec chmod 775 {} \; \
&& find /var/www/html/writable -type f -exec chmod 664 {} \;
# Adicionar script de inicialização
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["apache2-foreground"]
# Expor porta 80
EXPOSE 80