-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
87 lines (70 loc) · 2.34 KB
/
Copy pathDockerfile.dev
File metadata and controls
87 lines (70 loc) · 2.34 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Dockerfile para desarrollo de CronosMaticStore
FROM php:8.2-fpm
# Instalar dependencias del sistema
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
libjpeg-dev \
libfreetype6-dev \
zip \
unzip \
supervisor \
nginx \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip \
&& echo 'no' | pecl install redis \
&& docker-php-ext-enable redis \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Instalar Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Instalar Node.js 18 (versión específica desde NodeSource)
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs
# Instalar dependencias de Cypress para tests E2E
RUN apt-get update && apt-get install -y \
xvfb \
libgtk2.0-0 \
libgtk-3-0 \
libgbm-dev \
libnotify-dev \
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
xauth \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Crear directorio de trabajo
WORKDIR /var/www/html
# Copiar archivos de dependencias
COPY composer.json composer.lock ./
COPY package.json package-lock.json ./
# Instalar dependencias de PHP (incluyendo dev, sin scripts post-install)
RUN composer install --optimize-autoloader --no-interaction --no-scripts
# Instalar dependencias de Node.js (incluyendo dev)
RUN npm install
# Copiar el código de la aplicación
COPY . .
# Dar permisos de ejecución al script de inicio
RUN chmod +x /var/www/html/docker/dev-start.sh
# Ejecutar scripts post-install después de copiar el código
RUN composer run-script post-autoload-dump
# Configurar permisos
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html/storage \
&& chmod -R 755 /var/www/html/bootstrap/cache
# Configurar PHP para desarrollo
COPY docker/php/custom.ini /usr/local/etc/php/conf.d/custom.ini
# Configurar Nginx
COPY docker/nginx.conf /etc/nginx/sites-available/default
# Configurar Supervisor para desarrollo
COPY docker/supervisord.dev.conf /etc/supervisor/conf.d/supervisord.conf
# Exponer puertos
EXPOSE 80 3000 5173
# Comando de inicio para desarrollo
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]