-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (42 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
47 lines (42 loc) · 1.17 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
37
38
39
40
41
42
43
44
45
46
47
FROM php:8.3-fpm
# Instalar todas las dependencias del sistema y extensiones PHP en un solo RUN
RUN apt-get update && apt-get install -y \
nginx \
supervisor \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
libmariadb-dev-compat \
libmariadb-dev \
zip \
unzip \
curl \
&& docker-php-ext-install \
pdo \
pdo_mysql \
mysqli \
gd \
opcache \
zip \
mbstring \
exif \
pcntl \
bcmath \
sockets \
&& rm -rf /var/lib/apt/lists/*
# Copiar código fuente y configurar permisos
COPY . /var/www/html
WORKDIR /var/www/html
RUN chown -R www-data:www-data /var/www/html \
&& chown -R www-data:www-data /var/www/html/uploads
# Configurar Nginx
COPY ./nginx.conf /etc/nginx/sites-available/default
RUN ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default \
&& rm -f /etc/nginx/sites-enabled/default.conf
# Configurar PHP-FPM y Supervisord
COPY ./php-fpm.conf /usr/local/etc/php-fpm.d/www.conf
COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Exponer puerto y comando de inicio
EXPOSE 80
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]