Skip to content

Commit 101986c

Browse files
committed
merge the php versions dockerfiles in php-fpm, workspace and php-worker
1 parent add78a1 commit 101986c

16 files changed

Lines changed: 387 additions & 3774 deletions

File tree

DOCUMENTATION/content/documentation/index.md

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -215,28 +215,24 @@ The PHP-CLI extensions should be installed in `workspace/Dockerfile`.
215215
<br>
216216
<a name="Change-the-PHP-FPM-Version"></a>
217217
## Change the (PHP-FPM) Version
218-
By default **PHP-FPM 7.0** is running.
218+
By default the latest stable PHP versin is configured to run.
219219

220220
>The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.
221221
222222

223-
### A) Switch from PHP `7.0` to PHP `5.6`
223+
### A) Switch from PHP `7.2` to PHP `5.6`
224224

225-
1 - Open the `docker-compose.yml`.
225+
1 - Open the `.env`.
226226

227-
2 - Search for `Dockerfile-70` in the PHP container section.
227+
2 - Search for `PHP_VERSION`.
228228

229-
3 - Change the version number, by replacing `Dockerfile-70` with `Dockerfile-56`, like this:
229+
3 - Set the desired version number:
230230

231-
```yml
232-
php-fpm:
233-
build:
234-
context: ./php-fpm
235-
dockerfile: Dockerfile-56
236-
...
231+
```dotenv
232+
PHP_VERSION=5.6
237233
```
238234

239-
4 - Finally rebuild the container
235+
4 - Finally rebuild the image
240236

241237
```bash
242238
docker-compose build php-fpm
@@ -245,25 +241,6 @@ docker-compose build php-fpm
245241
> For more details about the PHP base image, visit the [official PHP docker images](https://hub.docker.com/_/php/).
246242
247243

248-
### B) Switch from PHP `7.0` or `5.6` to PHP `5.5`
249-
250-
We do not natively support PHP 5.5 anymore, but you can get it in few steps:
251-
252-
1 - Clone `https://github.com/laradock/php-fpm`.
253-
254-
3 - Rename `Dockerfile-56` to `Dockerfile-55`.
255-
256-
3 - Edit the file `FROM php:5.6-fpm` to `FROM php:5.5-fpm`.
257-
258-
4 - Build an image from `Dockerfile-55`.
259-
260-
5 - Open the `docker-compose.yml` file.
261-
262-
6 - Point `php-fpm` to your `Dockerfile-55` file.
263-
264-
265-
266-
267244

268245

269246
<br>
@@ -273,11 +250,23 @@ By default **PHP-CLI 7.0** is running.
273250

274251
>Note: it's not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job.
275252
276-
The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the `workspace/Dockerfile`.
253+
The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to simply change the `PHP_VERSION` in te .env file as follow:
254+
255+
1 - Open the `.env`.
277256

278-
Right now you have to manually edit the `Dockerfile` or create a new one like it's done for the PHP-FPM. (consider contributing).
257+
2 - Search for `PHP_VERSION`.
279258

259+
3 - Set the desired version number:
280260

261+
```dotenv
262+
PHP_VERSION=7.2
263+
```
264+
265+
4 - Finally rebuild the image
266+
267+
```bash
268+
docker-compose build workspace
269+
```
281270

282271

283272

@@ -558,7 +547,6 @@ b) add a new service container by simply copy-paste this section below PHP-FPM c
558547
php-worker:
559548
build:
560549
context: ./php-worker
561-
dockerfile: "Dockerfile-${PHP_VERSION}" #Dockerfile-71 or #Dockerfile-70 available
562550
args:
563551
- INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL} #Optionally install PGSQL PHP drivers
564552
volumes_from:

DOCUMENTATION/content/introduction/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ That's it! enjoy :)
5858
<a name="features"></a>
5959
## Features
6060
61-
- Easy switch between PHP versions: 7.1, 7.0, 5.6...
61+
- Easy switch between PHP versions: 7.2, 7.1, 5.6...
6262
- Choose your favorite database engine: MySQL, Postgres, MariaDB...
6363
- Run your own combination of software: Memcached, HHVM, Beanstalkd...
6464
- Every software runs on a separate container: PHP-FPM, NGINX, PHP-CLI...

docker-compose.sync.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ version: '3'
22

33
services:
44

5-
### Applications Code Container #############################
6-
7-
# applications:
8-
# image: tianon/true
9-
# volumes:
10-
# - applications-sync:/var/www:nocopy # nocopy is required
11-
12-
### Volumes Setup #############################################
13-
145
volumes:
156
applications-sync:
167
external:

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ services:
4747
build:
4848
context: ./workspace
4949
args:
50+
- PHP_VERSION=${PHP_VERSION}
5051
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
5152
- INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE}
5253
- INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP}
@@ -88,7 +89,6 @@ services:
8889
- TZ=${WORKSPACE_TIMEZONE}
8990
- BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID}
9091
- BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN}
91-
dockerfile: "Dockerfile-${PHP_VERSION}"
9292
volumes:
9393
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
9494
extra_hosts:
@@ -107,6 +107,7 @@ services:
107107
build:
108108
context: ./php-fpm
109109
args:
110+
- PHP_VERSION=${PHP_VERSION}
110111
- INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG}
111112
- INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE}
112113
- INSTALL_SOAP=${PHP_FPM_INSTALL_SOAP}
@@ -132,7 +133,6 @@ services:
132133
- INSTALL_SWOOLE=${PHP_FPM_INSTALL_SWOOLE}
133134
- INSTALL_IMAGE_OPTIMIZERS=${PHP_FPM_INSTALL_IMAGE_OPTIMIZERS}
134135
- INSTALL_IMAGEMAGICK=${PHP_FPM_INSTALL_IMAGEMAGICK}
135-
dockerfile: "Dockerfile-${PHP_VERSION}"
136136
volumes:
137137
- ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini
138138
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
@@ -149,8 +149,8 @@ services:
149149
php-worker:
150150
build:
151151
context: ./php-worker
152-
dockerfile: "Dockerfile-${PHP_VERSION}"
153152
args:
153+
- PHP_VERSION=${PHP_VERSION}
154154
- INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL}
155155
volumes:
156156
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}

env-example

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ COMPOSE_PATH_SEPARATOR=:
3131

3232
### PHP Version ###########################################
3333

34-
# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM). Accepted values: 72 - 71 - 70 - 56
35-
PHP_VERSION=72
34+
# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM). Accepted values: 7.2 - 7.1 - 7.0 - 5.6 - 5.5
35+
PHP_VERSION=7.2
3636

3737
### PHP Interpreter #######################################
3838

@@ -319,6 +319,11 @@ AEROSPIKE_FABRIC_PORT=3001
319319
AEROSPIKE_HEARTBEAT_PORT=3002
320320
AEROSPIKE_INFO_PORT=3003
321321

322+
## Temp solution, this should be in the dockerfile
323+
# for all versions "https://github.com/aerospike/aerospike-client-php/archive/master.tar.gz"
324+
# for php 7.2 (using this branch until the support for 7.2 on master) "https://github.com/aerospike/aerospike-client-php/archive/7.2.0-in-progress.tar.gz"
325+
AEROSPIKE_PHP_REPOSITORY=https://github.com/aerospike/aerospike-client-php/archive/7.2.0-in-progress.tar.gz
326+
322327
### RETHINKDB #############################################
323328

324329
RETHINKDB_PORT=8090
@@ -343,3 +348,7 @@ LARAVEL_ECHO_SERVER_PORT=6001
343348
SOLR_VERSION=5.5
344349
SOLR_PORT=8983
345350
SOLR_DATAIMPORTHANDLER_MYSQL=false
351+
352+
### DRUSH_VERSION #########################################
353+
354+
DRUSH_VERSION=9.2.3

0 commit comments

Comments
 (0)