Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# docker build . --tag registry.myjoomla.com/base-nginx-php
# docker push registry.myjoomla.com/base-nginx-php
FROM alpine:3.8
MAINTAINER Phil Taylor <phil@phil-taylor.com>
# PHP 7.3 Repos
#ADD https://repos.php.earth/alpine/phpearth.rsa.pub /etc/apk/keys/phpearth.rsa.pub
ADD https://php.codecasts.rocks/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
RUN apk --update add ca-certificates
#RUN echo "https://repos.php.earth/alpine/v3.8" >> /etc/apk/repositories
RUN echo "@php https://php.codecasts.rocks/v3.8/php-7.3" >> /etc/apk/repositories
RUN apk --no-cache update \
&& apk --no-cache upgrade \
&& apk add --no-cache \
# Base
supervisor \
sudo \
composer \
git \
openssh \
ca-certificates \
curl \
wget \
htop \
httpie \
nano \
zlib-dev \
procps \
gnupg \
\
# nginx
nginx \
\
# PHP
php@php \
php-dev@php \
php-fpm@php \
php-ftp@php \
php-curl@php \
php-zip@php \
php-mbstring@php \
php-pcntl@php \
php-posix@php \
php-iconv@php \
php-intl@php \
php-pdo_mysql@php \
php-tokenizer@php \
php-dom@php \
php-ctype@php \
php-bcmath@php \
php-gmp@php \
php-redis@php \
php-xml@php \
php-simplexml@php \
php-json@php \
php-sodium@php \
php-opcache@php \
php-soap@php \
php-fileinfo@php \
php-shmop@php \
php-xmlwriter@php \
php-session@php \
php-common@php
RUN sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 64M/g' /etc/php7/php.ini \
&& sed -i 's/post_max_size = 8M/post_max_size = 64M/g' /etc/php7/php.ini \
&& sed -i 's/log_errors = On/log_errors = Off/g' /etc/php7/php.ini \
&& sed -i 's/memory_limit = 128M/memory_limit = 1024M/g' /etc/php7/php.ini \
&& echo '[global]' > /etc/php7/php-fpm.d/zz-docker.conf \
&& echo 'daemonize = no' >> /etc/php7/php-fpm.d/zz-docker.conf \
&& echo '[www]' >> /etc/php7/php-fpm.d/zz-docker.conf \
&& echo 'listen=9000' >> /etc/php7/php-fpm.d/zz-docker.conf \
&& echo 'extension=redis' > /etc/php7/php-fpm.d/redis.ini \
# PHP CLI
&& echo 'realpath_cache_size=2048M' > /etc/php7/conf.d/pathcache.ini \
&& echo 'realpath_cache_ttl=7200' >> /etc/php7/conf.d/pathcache.ini \
&& echo '[opcache]' > /etc/php7/conf.d/opcache.ini \
&& echo 'opcache.memory_consumption = 512M' >> /etc/php7/conf.d/opcache.ini \
&& echo 'opcache.max_accelerated_files = 1000000' >> /etc/php7/conf.d/opcache.ini \
&& echo 'extension=redis' > /etc/php7/conf.d/redis.ini \
&& echo "default_socket_timeout=1200" >> /etc/php7/php.ini \
# Others
&& update-ca-certificates \
&& mkdir -p /run/nginx/ \
&& mkdir -p /var/log/nginx/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.