File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
FROM php:7.4-apache
2
2
3
- # Instalar dependencias del sistema
4
- RUN apt-get update && apt-get install -y \
3
+ # Actualizar los repositorios y limpiar cachés antes de instalar dependencias
4
+ RUN apt-get clean && apt-get update -y && apt-get install -y \
5
5
libmysqlclient-dev \
6
6
libonig-dev \
7
7
&& docker-php-ext-install pdo pdo_mysql mbstring
8
8
9
- # Copiar tu aplicación al contenedor
9
+ # Habilitar la reescritura de URL de Apache
10
+ RUN a2enmod rewrite
11
+
12
+ # Copiar archivos del proyecto
10
13
COPY . /var/www/html/
11
14
12
- # Habilitar el módulo de Apache para permitir .htaccess (si es necesario)
13
- RUN a2enmod rewrite
15
+ # Establecer permisos adecuados para los archivos
16
+ RUN chown -R www-data:www-data /var/www/html
17
+ RUN chmod -R 755 /var/www/html
14
18
15
19
# Exponer el puerto 80
16
20
EXPOSE 80
17
21
22
+ # Comando para iniciar Apache
23
+ CMD ["apache2-foreground" ]
24
+
25
+
You can’t perform that action at this time.
0 commit comments