Skip to content

Commit 1922352

Browse files
committed
Improve documentation
1 parent fd1ff26 commit 1922352

File tree

3 files changed

+55
-5
lines changed

3 files changed

+55
-5
lines changed

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ FROM php:7.4-fpm-alpine
44
# Maintainer
55
LABEL maintainer="Alexander Graf <alex@basecamp.tirol>"
66

7+
# Build arguments
8+
ARG VCS_REF=master
9+
ARG BUILD_DATE=""
10+
11+
# http://label-schema.org/rc1/
12+
LABEL org.label-schema.schema-version "1.0"
13+
LABEL org.label-schema.name "PHP7-FPM"
14+
LABEL org.label-schema.build-date "${BUILD_DATE}"
15+
LABEL org.label-schema.description "All-purpose PHP-FPM 7.4 Docker image that comes with the most popular extensions"
16+
LABEL org.label-schema.vcs-url "https://github.com/otherguy/docker-php7-fpm"
17+
LABEL org.label-schema.vcs-ref "${VCS_REF}"
18+
719
# Install dependencies
820
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
921
&& apk add --no-cache curl shadow sqlite curl-dev freetype-dev libpng-dev libjpeg-turbo-dev \

README.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,47 @@ or other PHP 7.4+ applications. Just use this lightweight and convenient image.
2222

2323
## 🌈 Quick Start
2424

25-
* simple example docker file
26-
* zz-**.ini files for custom config
27-
* apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && pecl install mongodb && docker-php-ext-enable mongodb
25+
### Create your Docker image
26+
27+
Base your Docker image on `otherguy/php7-fpm:7.4`, add your project files and you're ready to go!
28+
29+
```Dockerfile
30+
# Dockerfile
31+
FROM otherguy/php7-fpm:7.4
32+
33+
COPY --chown=www-data:www-data . /srv
34+
```
35+
36+
### Customize PHP settings
37+
38+
If you want to change the PHP configuration or overwrite some defaults, simply create your own
39+
configuration file, have the filename start with a `z` and add it to the image.
40+
41+
```ini
42+
# zz-custom.ini
43+
post_max_size = 100M
44+
upload_max_filesize = 100M
45+
```
46+
47+
```Dockerfile
48+
# Dockerfile
49+
...
50+
COPY zz-custom.ini /usr/local/etc/php/conf.d/
51+
...
52+
```
53+
54+
### Add PHP extensions
55+
56+
It's simple to add your own extensions to the image!
57+
58+
```Dockerfile
59+
# Dockerfile
60+
...
61+
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
62+
&& pecl install mongodb \
63+
&& docker-php-ext-enable mongodb
64+
...
65+
```
2866

2967
## 📚 Description
3068

conf/yy-custom.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ short_open_tag = Off
44
max_execution_time = 20
55
max_input_nesting_level = 32
66
memory_limit = 256M
7-
post_max_size = 50M
7+
post_max_size = 25M
88
default_charset = "utf-8"
9-
upload_max_filesize = 50M
9+
upload_max_filesize = 25M
1010
max_file_uploads = 5
1111
default_socket_timeout = 5
1212
display_errors = On

0 commit comments

Comments
 (0)