You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-22
Original file line number
Diff line number
Diff line change
@@ -349,87 +349,87 @@ Apart from the provided tools, you will also be able to use the container simila
349
349
350
350
#### Provide PHP-FPM port to host
351
351
```shell
352
-
$ docker run -d \
352
+
docker run -d -it \
353
353
-p 127.0.0.1:9000:9000 \
354
-
-t devilbox/php-fpm:7.2-prod
354
+
devilbox/php-fpm:7.2-prod
355
355
```
356
356
357
357
#### Alter PHP-FPM and system timezone
358
358
```shell
359
-
$ docker run -d \
359
+
docker run -d -it \
360
360
-p 127.0.0.1:9000:9000 \
361
361
-e TIMEZONE=Europe/Berlin \
362
-
-t devilbox/php-fpm:7.2-prod
362
+
devilbox/php-fpm:7.2-prod
363
363
```
364
364
365
365
#### Load custom PHP configuration
366
366
367
367
`config/` is a local directory that will hold the PHP *.ini files you want to load into the Docker container.
368
368
```shell
369
369
# Create config directory to be mounted with dummy configuration
370
-
$ mkdir config
370
+
mkdir config
371
371
# Xdebug 2
372
-
$ echo"xdebug.enable = 1"> config/xdebug.ini
372
+
echo"xdebug.enable = 1"> config/xdebug.ini
373
373
# Xdebug 3
374
-
$ echo"xdebug.mode = debug"> config/xdebug.ini
374
+
echo"xdebug.mode = debug"> config/xdebug.ini
375
375
376
376
# Run container and mount it
377
-
$ docker run -d \
377
+
docker run -d -it \
378
378
-p 127.0.0.1:9000:9000 \
379
379
-v config:/etc/php-custom.d \
380
-
-t devilbox/php-fpm:7.2-prod
380
+
devilbox/php-fpm:7.2-prod
381
381
```
382
382
383
383
#### MySQL connect via 127.0.0.1 (via port-forward)
384
384
385
385
Forward MySQL Port from `172.168.0.30` (or any other IP address/hostname) and Port `3306` to the PHP docker on `127.0.0.1:3306`. By this, your PHP files inside the docker can use `127.0.0.1` to connect to a MySQL database.
#### MySQL and Redis connect via 127.0.0.1 (via port-forward)
394
394
395
395
Forward MySQL Port from `172.168.0.30:3306` and Redis port from `redis:6379` to the PHP docker on `127.0.0.1:3306` and `127.0.0.1:6379`. By this, your PHP files inside the docker can use `127.0.0.1` to connect to a MySQL or Redis database.
Once you set `$ENABLE_MAIL=2`, all mails sent via any of your PHP applications no matter to which domain, are catched locally into the `devilbox` account. You can also mount the mail directory locally to hook in with mutt and read those mails.
406
406
```shell
407
-
$ docker run -d \
407
+
docker run -d -it \
408
408
-p 127.0.0.1:9000:9000 \
409
409
-v /tmp/mail:/var/mail \
410
410
-e ENABLE_MAIL=2 \
411
-
-t devilbox/php-fpm:7.2-prod
411
+
devilbox/php-fpm:7.2-prod
412
412
```
413
413
414
414
#### Webserver and PHP-FPM
415
415
416
416
`~/my-host-www` will be the directory that serves the php files (your document root). Make sure to mount it into both, php and the webserver.
417
417
```shell
418
418
# Start PHP-FPM container
419
-
$ docker run -d \
419
+
docker run -d -it \
420
420
-v ~/my-host-www:/var/www/default/htdocs \
421
421
--name php \
422
-
-t devilbox/php-fpm:7.2-prod
422
+
devilbox/php-fpm:7.2-prod
423
423
424
424
# Start webserver and link with PHP-FPM
425
-
$ docker run -d \
425
+
docker run -d -it \
426
426
-p 80:80 \
427
427
-v ~/my-host-www:/var/www/default/htdocs \
428
428
-e PHP_FPM_ENABLE=1 \
429
429
-e PHP_FPM_SERVER_ADDR=php \
430
430
-e PHP_FPM_SERVER_PORT=9000 \
431
431
--link php \
432
-
-t devilbox/nginx-mainline
432
+
devilbox/nginx-mainline
433
433
```
434
434
435
435
#### Create MySQL Backups
@@ -440,16 +440,16 @@ The MySQL server could be another Docker container linked to the PHP-FPM contain
0 commit comments