Last active
December 31, 2024 14:38
-
-
Save asterion/4f704d58e643548a913a808983643f15 to your computer and use it in GitHub Desktop.
Dockerfile Laravel PHP CLI 8.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment