Skip to content

Commit 9c552b0

Browse files
committed
Make README examples copy-able
1 parent 5613a40 commit 9c552b0

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

README.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -349,87 +349,87 @@ Apart from the provided tools, you will also be able to use the container simila
349349

350350
#### Provide PHP-FPM port to host
351351
```shell
352-
$ docker run -d \
352+
docker run -d -it \
353353
-p 127.0.0.1:9000:9000 \
354-
-t devilbox/php-fpm:7.2-prod
354+
devilbox/php-fpm:7.2-prod
355355
```
356356

357357
#### Alter PHP-FPM and system timezone
358358
```shell
359-
$ docker run -d \
359+
docker run -d -it \
360360
-p 127.0.0.1:9000:9000 \
361361
-e TIMEZONE=Europe/Berlin \
362-
-t devilbox/php-fpm:7.2-prod
362+
devilbox/php-fpm:7.2-prod
363363
```
364364

365365
#### Load custom PHP configuration
366366

367367
`config/` is a local directory that will hold the PHP *.ini files you want to load into the Docker container.
368368
```shell
369369
# Create config directory to be mounted with dummy configuration
370-
$ mkdir config
370+
mkdir config
371371
# Xdebug 2
372-
$ echo "xdebug.enable = 1" > config/xdebug.ini
372+
echo "xdebug.enable = 1" > config/xdebug.ini
373373
# Xdebug 3
374-
$ echo "xdebug.mode = debug" > config/xdebug.ini
374+
echo "xdebug.mode = debug" > config/xdebug.ini
375375

376376
# Run container and mount it
377-
$ docker run -d \
377+
docker run -d -it \
378378
-p 127.0.0.1:9000:9000 \
379379
-v config:/etc/php-custom.d \
380-
-t devilbox/php-fpm:7.2-prod
380+
devilbox/php-fpm:7.2-prod
381381
```
382382

383383
#### MySQL connect via 127.0.0.1 (via port-forward)
384384

385385
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.
386386
```shell
387-
$ docker run -d \
387+
docker run -d -it \
388388
-p 127.0.0.1:9000:9000 \
389389
-e FORWARD_PORTS_TO_LOCALHOST='3306:172.168.0.30:3306' \
390-
-t devilbox/php-fpm:7.2-prod
390+
devilbox/php-fpm:7.2-prod
391391
```
392392

393393
#### MySQL and Redis connect via 127.0.0.1 (via port-forward)
394394

395395
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.
396396
```shell
397-
$ docker run -d \
397+
docker run -d -it \
398398
-p 127.0.0.1:9000:9000 \
399399
-e FORWARD_PORTS_TO_LOCALHOST='3306:172.168.0.30:3306, 6379:redis:6379' \
400-
-t devilbox/php-fpm:7.2-prod
400+
devilbox/php-fpm:7.2-prod
401401
```
402402

403403
#### Launch Postfix for mail-catching
404404

405405
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.
406406
```shell
407-
$ docker run -d \
407+
docker run -d -it \
408408
-p 127.0.0.1:9000:9000 \
409409
-v /tmp/mail:/var/mail \
410410
-e ENABLE_MAIL=2 \
411-
-t devilbox/php-fpm:7.2-prod
411+
devilbox/php-fpm:7.2-prod
412412
```
413413

414414
#### Webserver and PHP-FPM
415415

416416
`~/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.
417417
```shell
418418
# Start PHP-FPM container
419-
$ docker run -d \
419+
docker run -d -it \
420420
-v ~/my-host-www:/var/www/default/htdocs \
421421
--name php \
422-
-t devilbox/php-fpm:7.2-prod
422+
devilbox/php-fpm:7.2-prod
423423

424424
# Start webserver and link with PHP-FPM
425-
$ docker run -d \
425+
docker run -d -it \
426426
-p 80:80 \
427427
-v ~/my-host-www:/var/www/default/htdocs \
428428
-e PHP_FPM_ENABLE=1 \
429429
-e PHP_FPM_SERVER_ADDR=php \
430430
-e PHP_FPM_SERVER_PORT=9000 \
431431
--link php \
432-
-t devilbox/nginx-mainline
432+
devilbox/nginx-mainline
433433
```
434434

435435
#### Create MySQL Backups
@@ -440,16 +440,16 @@ The MySQL server could be another Docker container linked to the PHP-FPM contain
440440

441441
```
442442
# Start container
443-
$ docker run -d \
443+
docker run -d -it \
444444
-e MYSQL_BACKUP_USER=root \
445445
-e MYSQL_BACKUP_PASS=somepass \
446446
-e MYSQL_BACKUP_HOST=mysql \
447447
-v ~/backups:/shared/backups \
448448
--name php \
449-
-t devilbox/php-fpm:7.2-work
449+
devilbox/php-fpm:7.2-work
450450
451451
# Run database dump
452-
$ docker exec -it php mysqldump-secure
452+
docker exec -it php mysqldump-secure
453453
```
454454

455455
#### Docker Compose reference implementation

0 commit comments

Comments
 (0)