Skip to content

Instantly share code, notes, and snippets.

@Sekaiichi
Created October 5, 2019 17:54
Show Gist options
  • Save Sekaiichi/967ec6a5b998b69c6e206e19eb059a44 to your computer and use it in GitHub Desktop.
Save Sekaiichi/967ec6a5b998b69c6e206e19eb059a44 to your computer and use it in GitHub Desktop.
FROM php:7.1.3-fpm-alpine
MAINTAINER Mehrubon Khusaynov <husaynov888@gmailc.com>
ENV TIMEZONE Asia/Dushanbe
RUN apk upgrade --update && apk --no-cache add \
autoconf tzdata file g++ gcc binutils isl libatomic libc-dev musl-dev make re2c libstdc++ libgcc libcurl curl-dev binutils-libs mpc1 mpfr3 gmp libgomp coreutils freetype-dev libjpeg-turbo-dev libltdl libmcrypt-dev libpng-dev openssl-dev libxml2-dev expat-dev postgresql-dev ffmpeg \
&& docker-php-ext-install -j$(nproc) iconv mysqli pdo pdo_mysql curl bcmath mcrypt mbstring json xml zip opcache pdo_pgsql pgsql \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
# TimeZone
RUN cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
&& echo "${TIMEZONE}" > /etc/timezone
# Install Composer && Assets Plugin
RUN php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer global require --no-progress "fxp/composer-asset-plugin:~1.2" \
&& apk del tzdata \
&& rm -rf /var/cache/apk/*
ENV FFMPEG_VERSION=3.0.2
WORKDIR /tmp/ffmpeg
RUN apk add --update build-base curl nasm tar bzip2 \
zlib-dev openssl-dev yasm-dev lame-dev libogg-dev x264-dev libvpx-dev libvorbis-dev x265-dev freetype-dev libass-dev libwebp-dev rtmpdump-dev libtheora-dev opus-dev && \
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz | tar zxvf - -C . && \
cd ffmpeg-${FFMPEG_VERSION} && \
./configure \
--enable-version3 --enable-gpl --enable-nonfree --enable-small --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libtheora --enable-libvorbis --enable-libopus --enable-libass --enable-libwebp --enable-librtmp --enable-postproc --enable-avresample --enable-libfreetype --enable-openssl --disable-debug && \
make && \
make install && \
make distclean && \
rm -rf ${DIR} && \
apk del build-base curl tar bzip2 x264 openssl nasm && rm -rf /var/cache/apk/*
EXPOSE 9000
CMD ["php-fpm"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment