Skip to content

Commit e6e574b

Browse files
committed
Update Docker image
1 parent 456b362 commit e6e574b

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@ FROM php:7.4-fpm-alpine
55
LABEL maintainer="Alexander Graf <alex@basecamp.tirol>"
66

77
# Install dependencies
8-
RUN apk --update add --no-cache \
9-
curl curl-dev shadow freetype-dev libpng-dev libjpeg-turbo-dev postgresql-dev \
10-
imagemagick-dev icu-dev openssl-dev oniguruma-dev libzip-dev gcc g++ autoconf make
8+
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
9+
&& apk add --no-cache curl shadow sqlite curl-dev freetype-dev libpng-dev libjpeg-turbo-dev \
10+
postgresql-dev imagemagick-dev icu-dev openssl-dev oniguruma-dev libzip-dev
1111

1212
RUN docker-php-ext-configure gd \
1313
--with-freetype=/usr/include/ \
1414
--with-jpeg=/usr/include/ \
15-
&& docker-php-ext-install gd intl mysqli opcache pdo_mysql pdo_pgsql \
16-
&& apk del --no-cache gcc g++ autoconf make \
15+
&& docker-php-ext-install -j$(nproc) gd intl mysqli opcache pdo_mysql pdo_pgsql \
16+
&& apk del --no-cache .build-deps $PHPIZE_DEPS \
1717
&& rm -rf /var/cache/apk/*
1818

19+
# Install composer
20+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
21+
1922
# PHP Config
2023
COPY conf/*.ini /usr/local/etc/php/conf.d/
2124

@@ -29,7 +32,8 @@ RUN usermod -u 1000 www-data
2932
# Change working directory
3033
WORKDIR /srv
3134

32-
# PHP config directory is a volume
35+
# PHP config directory and /srv are volumes
36+
VOLUME /srv
3337
VOLUME /usr/local/etc/php/conf.d/
3438

3539
# UTF-8 default

README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,40 @@ _All-purpose PHP-FPM 7.4 Docker image that comes with the most popular extension
1515
[stargazers]: https://github.com/otherguy/php7-fpm/stargazers
1616
[issues]: https://github.com/otherguy/docker-php7-fpm/issues
1717

18-
19-
Dont worry about your favorite currency conversion service suddenly shutting down or switching plans on you. Switc
18+
Don't worry about building complex Docker images for your [Laravel](https://laravel.com), [Lumen](https://lumen.laravel.com)
19+
or other PHP 7.4+ applications. Just use this lightweight and convenient image.
2020

2121
$ docker pull otherguy/php7-fpm:7.4
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
2528

2629
## 📚 Description
2730

28-
This is a docker image for an all-purpose PHP-FPM (PHP Version 7.4) container. It is based on the `7.4-alpine`
31+
This is a docker image for an all-purpose PHP-FPM (PHP Version 7.4) container. It is based on the `7.4-fpm-alpine`
2932
tag of the [official PHP Docker image](https://hub.docker.com/_/php/). [Patch version](http://semver.org) upgrades
30-
are therefore done automatically on build (e.g. `7.0.11` to `7.0.12`) but for minor version upgrades
31-
(e.g. `7.2.x` to `7.3.x`), a new Dockerfile should be created and tagged appropriately.
33+
are therefore done automatically on build (e.g. `7.4.11` to `7.4.12`) but for minor version upgrades
34+
(e.g. `7.3.x` to `7.4.x`), a new `Dockerfile` should be created and tagged appropriately.
3235

3336
## 🆕 New and Removed Features
3437

35-
There are some new features and deprecated parts in PHP 7.2 that made changes to the Dockerfile necessary:
38+
There are some new features and deprecated modules that made changes to the `Dockerfile` necessary:
3639

37-
* `mcrypt` has been [deprecated in 7.1 and removed in 7.2](http://php.net/manual/en/migration71.deprecated.php) in favor of OpenSSL
40+
* `mcrypt` has been [deprecated in 7.1 and removed in 7.2](http://php.net/manual/en/migration71.deprecated.php) in
41+
favor of OpenSSL
42+
* PHP 7.4 includes many of the extensions that were previously installed manually, so only `gd`, `intl`, `opcache` and
43+
PDO are installed through this image
3844

3945
## 🧮 Extensions
4046

4147
The installed extensions are enough for [Laravel 8 projects](https://laravel.com/docs/8.x/installation) as long as the project
42-
is using either PostgreSQL or MySQL. If you need other database drivers/extensions, please fork this image and submit
43-
a [pull requests](https://github.com/otherguy/docker-php7-fpm/pulls)!
44-
48+
is using either PostgreSQL, MySQL or SQLite. If you need other database drivers/extensions, please fork this image and submit
49+
a [pull requests](https://github.com/otherguy/docker-php7-fpm/pulls), or simply install it in your own image.
4550

46-
This is the full list of preinstalled PHP extensions in this image:
51+
This is the full list of extensions available to PHP in this image:
4752

4853
* `ctype`
4954
* `curl`

conf/zz-custom.ini renamed to conf/yy-custom.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ mbstring.detect_order = auto
4040
mbstring.func_overload = 0
4141

4242
[Date]
43-
date.timezone = "UTC"
43+
date.timezone = "UTC"

0 commit comments

Comments
 (0)