Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
otherguy committed Nov 17, 2020
1 parent fd1ff26 commit 1922352
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ FROM php:7.4-fpm-alpine
# Maintainer
LABEL maintainer="Alexander Graf <[email protected]>"

# 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 \
Expand Down
44 changes: 41 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions conf/yy-custom.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1922352

Please sign in to comment.