Skip to content

Commit

Permalink
chore: add zlib-dev dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePushMaker committed Dec 31, 2024
1 parent 5696bfa commit 081dab2
Showing 1 changed file with 6 additions and 36 deletions.
42 changes: 6 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ RUN apk add --update --no-cache \
icu-dev \
libxml2-dev \
curl-dev \
git && \ # Añadimos git para instalar Swoole desde PECL
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 && \
docker-php-ext-install -j$(nproc) mbstring xml curl zip bcmath soap intl pcntl && \
docker-php-ext-install -j$(nproc) gd mbstring xml curl zip bcmath soap intl pcntl && \
pecl install swoole && \
docker-php-ext-enable swoole && \ # Activamos la extensión Swoole
docker-php-ext-enable swoole && \
apk del autoconf gcc g++ make

# Instalamos Composer
RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer
--install-dir=/usr/local/bin --filename=composer

# Copiamos Roadrunner desde su imagen oficial
COPY --from=spiralscout/roadrunner:2.4.2 /usr/bin/rr /usr/bin/rr
Expand All @@ -46,34 +46,4 @@ WORKDIR /app
COPY . .

# Creamos el archivo de base de datos SQLite y ajustamos permisos
RUN mkdir -p /app/database && touch /app/database/database.sqlite
RUN chmod 777 /app/database/database.sqlite

# 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

# Configuramos el entorno
COPY .env.example .env

# Creamos directorios necesarios
RUN mkdir -p /app/storage/logs

# Ejecutar migraciones y luego limpiar 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"]
RUN mkdir -p /app/database && touch /app/database/database.sql

0 comments on commit 081dab2

Please sign in to comment.