-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
33 lines (26 loc) · 870 Bytes
/
dockerfile
File metadata and controls
33 lines (26 loc) · 870 Bytes
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
# Usa imagem oficial do PHP com Apache
FROM php:8.3-apache
# Instala dependências
RUN apt-get update && apt-get install -y \
git unzip curl libzip-dev libpq-dev \
&& docker-php-ext-install pdo pdo_pgsql zip
# Instala o Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copia o projeto para o container
WORKDIR /var/www/html
COPY . .
# Instala dependências do Laravel
RUN composer install --optimize-autoloader --no-dev
# Permissões de pastas
RUN chmod -R 775 storage bootstrap/cache
# Configura Apache para servir da pasta public/
RUN a2enmod rewrite
RUN echo "<VirtualHost *:80>
DocumentRoot /var/www/html/public
<Directory /var/www/html/public>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>" > /etc/apache2/sites-available/000-default.conf
EXPOSE 80
CMD ["apache2-foreground"]