-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (45 loc) · 1.49 KB
/
Dockerfile
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
FROM php:8.2-fpm-alpine
# Instalar dependencias y extensiones PHP en una sola capa
RUN apk add --no-cache nginx wget \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
freetype-dev \
libxml2-dev \
icu-dev \
libzip-dev \
&& docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype \
&& docker-php-ext-configure intl \
&& docker-php-ext-install -j$(nproc) \
mysqli \
pdo \
pdo_mysql \
gd \
zip \
bcmath \
intl \
opcache \
&& docker-php-ext-enable pdo_mysql intl \
&& mkdir -p /run/nginx /app \
&& chown -R www-data:www-data /app
# Copiar configuraciones
COPY docker/php.ini /usr/local/etc/php/conf.d/docker-php.ini
COPY docker/nginx.conf /etc/nginx/nginx.conf
# Configurar directorio de trabajo
WORKDIR /app
# Copiar los archivos del proyecto
COPY --chown=www-data:www-data . /app
# Instalar Composer y dependencias
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN composer install --no-dev --optimize-autoloader \
&& php artisan icons:cache \
&& php artisan filament:cache-components \
&& php artisan route:cache \
&& php artisan view:cache \
&& php artisan event:cache
# && php artisan config:cache
# && php artisan optimize \
#// No reconoce las variables de entorno para poder ejecutar las migraciones
# && php artisan migrate --force
# Comando para iniciar la aplicación
CMD sh /app/docker/startup.sh