Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creación de imagen php

README

Dockerfile para crear una imagen heredada de php basada en una imagen oficial 7.4.12-fpm que incluye composer y la extensión GD

Para instalar extensiones manualmente.

docker exec -ti <container-id> sh
>> docker-php-ext-install mysqli 
>> docker-php-ext-enable mysqli
>> apachectl restart
FROM php:7.4.12-fpm
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
software-properties-common \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
libfreetype6-dev \
libicu-dev \
libssl-dev \
libonig-dev \
libjpeg62-turbo-dev \
libpng-dev \
libmcrypt-dev \
libedit-dev \
libedit2 \
libpq-dev \
libxslt1-dev \
libzip-dev \
apt-utils \
gnupg \
git \
vim \
wget \
lynx \
psmisc \
unzip \
tar \
curl \
cron \
bash-completion \
&& apt-get clean
RUN docker-php-ext-configure \
gd --with-freetype --with-jpeg \
&& docker-php-ext-install \
opcache \
gd \
fileinfo \
xml \
pdo \
bcmath \
intl \
json \
mysqli \
pdo_mysql \
mbstring \
soap \
xsl \
exif \
zip
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN docker-php-ext-configure intl
RUN chmod 777 -R /var/www \
&& chown -R www-data:www-data /var/www \
&& usermod -u 1000 www-data \
&& chsh -s /bin/bash www-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment