Skip to content

Instantly share code, notes, and snippets.

@asterion
Last active December 31, 2024 14:38
Show Gist options
  • Select an option

  • Save asterion/4f704d58e643548a913a808983643f15 to your computer and use it in GitHub Desktop.

Select an option

Save asterion/4f704d58e643548a913a808983643f15 to your computer and use it in GitHub Desktop.

Revisions

  1. asterion renamed this gist Dec 31, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. asterion created this gist Dec 31, 2024.
    37 changes: 37 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    FROM php:8.1-cli

    # Instalar extensiones y dependencias necesarias
    RUN apt-get update && apt-get install -y \
    libzip-dev \
    unzip \
    git \
    libonig-dev \
    libpng-dev \
    libjpeg-dev \
    libfreetype6-dev \
    libpq-dev \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && pecl install redis \
    && docker-php-ext-enable redis \
    && docker-php-ext-install \
    pdo_mysql \
    pdo_pgsql \
    zip \
    gd \
    pcntl \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

    # Instalar Composer
    COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

    # Configurar el directorio de trabajo
    WORKDIR /var/www/html

    # Ajustar permisos
    RUN chown -R www-data:www-data /var/www/html \
    && chmod -R 755 /var/www/html

    # Variables de entorno para PHP
    ENV APP_ENV=local
    ENV APP_DEBUG=true