delete the Dockerfile-55 file and rename Dockerfile-56 to Dockerfile-5
Since 5.5 and 5.6 dockerfiles are identical execept the base image php version. Will let the users switch the php 5.6 and 5.5 version from the Dockerfile-5 by changing one char in the first line. Removing this duplication will make contribution and maintance easier and faster.
This commit is contained in:
parent
28a2d8e072
commit
23b0906cd7
40
README.md
40
README.md
|
@ -659,20 +659,18 @@ The PHP-CLI extensions should be installed in `workspace/Dockerfile`.
|
|||
|
||||
<br>
|
||||
<a name="Change-the-PHP-FPM-Version"></a>
|
||||
### Change the PHP-FPM Version
|
||||
### Change the (PHP-FPM) Version
|
||||
By default **PHP-FPM 7.0** is running.
|
||||
|
||||
>The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planing to run your application on different PHP-FPM version.
|
||||
|
||||
#### A) Switch from PHP `7.0` to PHP `5.6`
|
||||
|
||||
1 - Open the `docker-compose.yml`.
|
||||
|
||||
2 - Search for `Dockerfile-70` in the PHP container section.
|
||||
|
||||
3 - Change the version number.
|
||||
<br>
|
||||
Example to select version 5.6 instead of 7.0 you have to replace `Dockerfile-70` with `Dockerfile-56`.
|
||||
|
||||
Sample:
|
||||
3 - Change the version number, by replacing `Dockerfile-70` with `Dockerfile-5`, like this:
|
||||
|
||||
```txt
|
||||
php-fpm:
|
||||
|
@ -681,19 +679,35 @@ php-fpm:
|
|||
dockerfile: Dockerfile-70
|
||||
```
|
||||
|
||||
Supported Versions:
|
||||
|
||||
- For (PHP 7.0.*) use `Dockerfile-70`
|
||||
- For (PHP 5.6.*) use `Dockerfile-56`
|
||||
- For (PHP 5.5.*) use `Dockerfile-55`
|
||||
|
||||
|
||||
4 - Finally rebuild the container
|
||||
|
||||
```bash
|
||||
docker-compose build php
|
||||
```
|
||||
|
||||
#### B) Switch from PHP `7.0` or `5.6` to PHP `5.5`
|
||||
|
||||
1 - Follow the steps of (Switch from PHP `7.0` to PHP `5.6`) except the last one "rebuilding container".
|
||||
|
||||
2 - Open the `docker-compose.yml` again and make sure you are using `Dockerfile-5` like this:
|
||||
|
||||
```txt
|
||||
php-fpm:
|
||||
build:
|
||||
context: ./php-fpm
|
||||
dockerfile: Dockerfile-5
|
||||
```
|
||||
|
||||
3 - Open `php-fpm/Dockerfile-5` file and on the first line replace the PHP version from (`FROM php:5.6-fpm`) to (`FROM php:5.5-fpm`).
|
||||
|
||||
4 - Now you can rebuild the container
|
||||
|
||||
```bash
|
||||
docker-compose build php
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
For more details about the PHP base image, visit the [official PHP docker images](https://hub.docker.com/_/php/).
|
||||
|
||||
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
FROM php:5.5-fpm
|
||||
|
||||
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||
|
||||
ADD ./laravel.ini /usr/local/etc/php/conf.d
|
||||
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libpq-dev \
|
||||
libmemcached-dev \
|
||||
curl \
|
||||
libjpeg-dev \
|
||||
libpng12-dev \
|
||||
libfreetype6-dev \
|
||||
libssl-dev \
|
||||
libmcrypt-dev \
|
||||
--no-install-recommends \
|
||||
&& rm -r /var/lib/apt/lists/*
|
||||
|
||||
# install mcrypt library
|
||||
RUN docker-php-ext-install mcrypt
|
||||
|
||||
# Install mongodb driver
|
||||
RUN pecl install mongodb
|
||||
|
||||
# configure gd library
|
||||
RUN docker-php-ext-configure gd \
|
||||
--enable-gd-native-ttf \
|
||||
--with-jpeg-dir=/usr/lib \
|
||||
--with-freetype-dir=/usr/include/freetype2
|
||||
|
||||
# Install extensions using the helper script provided by the base image
|
||||
RUN docker-php-ext-install \
|
||||
pdo_mysql \
|
||||
pdo_pgsql \
|
||||
gd
|
||||
|
||||
# Install memcached
|
||||
RUN pecl install memcached \
|
||||
&& docker-php-ext-enable memcached
|
||||
|
||||
# Install xdebug
|
||||
RUN pecl install xdebug \
|
||||
&& docker-php-ext-enable xdebug
|
||||
|
||||
RUN usermod -u 1000 www-data
|
||||
|
||||
WORKDIR /var/www/laravel
|
||||
|
||||
CMD ["php-fpm"]
|
||||
|
||||
EXPOSE 9000
|
Loading…
Reference in New Issue