From 19223524297acb41a741913f3a343428490b2bad Mon Sep 17 00:00:00 2001 From: Alecander Graf Date: Tue, 17 Nov 2020 11:19:20 +0100 Subject: [PATCH] Improve documentation --- Dockerfile | 12 ++++++++++++ README.md | 44 +++++++++++++++++++++++++++++++++++++++++--- conf/yy-custom.ini | 4 ++-- 3 files changed, 55 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 91675e6..353fe99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,18 @@ FROM php:7.4-fpm-alpine # Maintainer LABEL maintainer="Alexander Graf " +# Build arguments +ARG VCS_REF=master +ARG BUILD_DATE="" + +# http://label-schema.org/rc1/ +LABEL org.label-schema.schema-version "1.0" +LABEL org.label-schema.name "PHP7-FPM" +LABEL org.label-schema.build-date "${BUILD_DATE}" +LABEL org.label-schema.description "All-purpose PHP-FPM 7.4 Docker image that comes with the most popular extensions" +LABEL org.label-schema.vcs-url "https://github.com/otherguy/docker-php7-fpm" +LABEL org.label-schema.vcs-ref "${VCS_REF}" + # Install dependencies RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ && apk add --no-cache curl shadow sqlite curl-dev freetype-dev libpng-dev libjpeg-turbo-dev \ diff --git a/README.md b/README.md index d23f6c3..93b6a1b 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,47 @@ or other PHP 7.4+ applications. Just use this lightweight and convenient image. ## 🌈 Quick Start -* simple example docker file -* zz-**.ini files for custom config -* apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && pecl install mongodb && docker-php-ext-enable mongodb +### Create your Docker image + +Base your Docker image on `otherguy/php7-fpm:7.4`, add your project files and you're ready to go! + +```Dockerfile +# Dockerfile +FROM otherguy/php7-fpm:7.4 + +COPY --chown=www-data:www-data . /srv +``` + +### Customize PHP settings + +If you want to change the PHP configuration or overwrite some defaults, simply create your own +configuration file, have the filename start with a `z` and add it to the image. + +```ini +# zz-custom.ini +post_max_size = 100M +upload_max_filesize = 100M +``` + +```Dockerfile +# Dockerfile +... +COPY zz-custom.ini /usr/local/etc/php/conf.d/ +... +``` + +### Add PHP extensions + +It's simple to add your own extensions to the image! + +```Dockerfile +# Dockerfile +... +RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ + && pecl install mongodb \ + && docker-php-ext-enable mongodb +... +``` ## 📚 Description diff --git a/conf/yy-custom.ini b/conf/yy-custom.ini index a3b2a57..b5c72d4 100755 --- a/conf/yy-custom.ini +++ b/conf/yy-custom.ini @@ -4,9 +4,9 @@ short_open_tag = Off max_execution_time = 20 max_input_nesting_level = 32 memory_limit = 256M -post_max_size = 50M +post_max_size = 25M default_charset = "utf-8" -upload_max_filesize = 50M +upload_max_filesize = 25M max_file_uploads = 5 default_socket_timeout = 5 display_errors = On