-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (30 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
36 lines (30 loc) · 1.1 KB
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
# Usamos PHP con Apache para facilitar la configuración en Render
FROM php:8.2-apache
# 1. Instalar dependencias del sistema y PHP
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
zip \
libzip-dev \
unzip \
git \
libicu-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-configure intl \
&& docker-php-ext-install pdo_mysql gd zip
# 2. Configurar Apache para Laravel (apuntar a /public)
ENV APACHE_DOCUMENT_ROOT /var/www/html/public
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
RUN a2enmod rewrite
# 3. Instalar Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# 4. Copiar archivos y dar permisos
WORKDIR /var/www/html
COPY . .
RUN composer install --no-dev --optimize-autoloader
RUN chown -R www-data:www-data storage bootstrap/cache
# Puerto que Render asignará dinámicamente
EXPOSE 80
CMD ["apache2-foreground"]