Skip to content

Commit

Permalink
chore: fix configurando manualmente las extensiones
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePushMaker committed Dec 31, 2024
1 parent 081dab2 commit d7b2a7d
Showing 1 changed file with 50 additions and 12 deletions.
62 changes: 50 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,26 @@ RUN apk add --update --no-cache \
libxml2-dev \
curl-dev \
git \
zlib-dev && \ # Necesario para Swoole
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
--with-xpm && \
docker-php-ext-install -j$(nproc) gd mbstring xml curl zip bcmath soap intl pcntl && \
pecl install swoole && \
docker-php-ext-enable swoole && \
apk del autoconf gcc g++ make
zlib-dev

# Instalamos extensiones de PHP manualmente
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm && \
docker-php-ext-install -j$(nproc) \
gd \
mbstring \
xml \
curl \
zip \
bcmath \
soap \
intl \
pcntl

# Instalamos Swoole con PECL
RUN pecl install swoole && docker-php-ext-enable swoole

# Limpiamos dependencias de compilación para reducir el tamaño de la imagen
RUN apk del autoconf gcc g++ make

# Instalamos Composer
RUN curl -sS https://getcomposer.org/installer | php -- \
Expand All @@ -45,5 +55,33 @@ WORKDIR /app
# Copiamos los archivos del proyecto
COPY . .

# Creamos el archivo de base de datos SQLite y ajustamos permisos
RUN mkdir -p /app/database && touch /app/database/database.sql
# Configuramos el entorno
COPY .env.example .env

# Eliminamos archivos previos
RUN rm -rf /app/vendor
RUN rm -rf /app/composer.lock

# Instalamos dependencias de Composer
RUN composer install
RUN composer require laravel/octane spiral/roadrunner

# Creamos directorios necesarios
RUN mkdir -p /app/storage/logs
RUN mkdir -p /app/database && touch /app/database/database.sqlite
RUN chmod 777 /app/database/database.sqlite

# Ejecutamos migraciones y limpiamos cachés
RUN php artisan migrate --force
RUN php artisan cache:clear
RUN php artisan view:clear
RUN php artisan config:clear

# Instalamos Octane con Swoole
RUN php artisan octane:install --server="swoole"

# Exponemos el puerto
EXPOSE 8000

# Comando para iniciar Octane
CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0"]

0 comments on commit d7b2a7d

Please sign in to comment.