Public Repository

Last pushed: 7 days ago
Short Description
php:fpm-alpine + PDO + Zip + GD + composer + ffmpeg + ffprobe + cron + lsyncd
Full Description

FROM php:fpm-alpine

RUN set -ex \
&& cd /usr/local/bin \
&& apk add --no-cache --virtual .fetch-deps curl zlib-dev zip unzip g++ \
&& sh docker-php-source extract \
&& sh docker-php-ext-configure zip \
&& sh docker-php-ext-install zip pdo pdo_mysql \
&& cp /usr/local/lib/php/extensions/no-debug-non-zts-20160303/* /usr/local/lib/php/extensions/ \
&& sh docker-php-ext-enable zip pdo pdo_mysql \
&& curl https://getcomposer.org/composer.phar -q -o /usr/local/bin/composer \
&& chmod +x /usr/local/bin/composer \
&& apk del .fetch-deps \
&& cd /usr/local/etc \
&& if [ -d php-fpm.d ]; then sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; cp php-fpm.d/www.conf.default php-fpm.d/www.conf; else mkdir php-fpm.d; cp php-fpm.conf.default php-fpm.d/www.conf; { echo '[global]'; echo 'include=etc/php-fpm.d/.conf'; } | tee php-fpm.conf; fi \
&& { echo '[global]'; echo 'error_log = /proc/self/fd/2'; echo; echo '[www]'; echo '; if we send this to /proc/self/fd/1, it never appears'; echo 'access.log = /proc/self/fd/2'; echo; echo 'clear_env = no'; echo; echo '; Ensure worker stdout and stderr are sent to the main error log.'; echo 'catch_workers_output = yes'; } | tee php-fpm.d/docker.conf \
&& { echo '[global]'; echo 'daemonize = no'; echo; echo '[www]'; echo 'listen = [::]:9000'; } | tee php-fpm.d/zz-docker.conf \
&& php -m

RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev \
&& docker-php-ext-configure gd \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
&& NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
&& docker-php-ext-install -j${NPROC} gd \
&& apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev

RUN set -ex \
&& apk add --no-cache --virtual .fetch-deps openssl \
&& mkdir -p /usr/src \
&& cd /usr/src \
&& wget -q http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz \
&& tar xJf /usr/src/ffmpeg-release-64bit-static.tar.xz -C /usr/src \
&& find /usr/src/ffmpe/ffmpeg | xargs -I {} mv {} /usr/local/bin/ \
&& find /usr/src/ffmpe
/ffprobe | xargs -I {} mv {} /usr/local/bin/ \
&& chmod +x /usr/local/bin/ffmpeg \
&& chmod +x /usr/local/bin/ffprobe \
&& rm -rf /usr/src \
&& apk del .fetch-deps

RUN sed '1a /bin/sh -c "/usr/sbin/crond -b -L /cron.log"' /usr/local/bin/docker-php-entrypoint > /usr/local/bin/docker-php-entrypoint2 \
; sed '1a /bin/sh -c "crontab /cron.dist"' /usr/local/bin/docker-php-entrypoint2 > /usr/local/bin/docker-php-entrypoint \
; sed '1a /bin/sh -c "printenv | grep CRONCOMMAND | cut -d \"=\" -f2 >> /cron.dist"' /usr/local/bin/docker-php-entrypoint > /usr/local/bin/docker-php-entrypoint2 \
; sed '1a /bin/sh -c "printenv | grep CRONFILE | cut -d \"=\" -f2|xargs cat >> /cron.dist"' /usr/local/bin/docker-php-entrypoint2 > /usr/local/bin/docker-php-entrypoint \
; sed '1a if [ -f /lsyncd.conf.lua ]; then /bin/sh -c "lsyncd /lsyncd.conf.lua" ; else echo "[LSYNCD] No config file found!"; fi' /usr/local/bin/docker-php-entrypoint > /usr/local/bin/docker-php-entrypoint2 \
; cat /usr/local/bin/docker-php-entrypoint2 > /usr/local/bin/docker-php-entrypoint \
; rm /usr/local/bin/docker-php-entrypoint2 \
; cat /usr/local/bin/docker-php-entrypoint

RUN set -ex \
&& apk add --no-cache lsyncd \
&& lsyncd -version

ENTRYPOINT ["docker-php-entrypoint"]

CMD ["php-fpm"]

EXPOSE 9000

Docker Pull Command
Owner
lagstorm

Comments (0)