@@ -11,27 +11,30 @@ You can use [PHP-PM](https://github.com/php-pm/php-pm) using Docker. We provide
1111### Examples
1212
1313```
14+ # change into your project folder first
15+ cd your/symfony-project/
16+
1417# see what php-pm binary can do for you.
1518$ docker run -v `pwd`:/var/www/ phppm/ppm --help
1619$ docker run -v `pwd`:/var/www/ phppm/ppm config --help
1720
1821# with nginx as static file server
19- $ docker run --rm --name ppm - v `pwd`:/var/www -p 8080:80 phppm/nginx:latest
22+ $ docker run -v `pwd`:/var/www -p 8080:80 phppm/nginx
2023
2124# with php-pm as static file server (dev only)
22- $ docker run --rm --name ppm - v `pwd`:/var/www -p 8080:80 phppm/nginx:latest
25+ $ docker run -v `pwd`:/var/www -p 8080:80 phppm/standalone
2326
2427# use `PPM_CONFIG` environment variable to choose a different ppm config file.
25- $ docker run --rm --name ppm -e PPM_CONFIG=ppm-prod.json - v `pwd`:/var/www -p 80:80 phppm/nginx:latest
28+ $ docker run - v `pwd`:/var/www -p 80:80 phppm/nginx -c ppm-prod.json
2629
2730# enable file tracking, to automatically restart ppm when php source changed
28- $ docker run --rm --name ppm -e PPM_DEBUG=1 -e PPM_APP_ENV=dev - v `pwd`:/var/www -p 80:80 phppm/nginx:latest
31+ $ docker run -v `pwd`:/var/www -p 80:80 phppm/nginx --debug=1 --app-env=dev
2932
3033# change static file directory. PPM_STATIC relative to mounted /var/www/.
31- $ docker run --rm --name ppm -e PPM_STATIC=./web/ - v `pwd`:/var/www -p 80:80 phppm/nginx:latest
34+ $ docker run -v `pwd`:/var/www -p 80:80 phppm/nginx --static-directory=web/
3235
3336# Use 16 threads/workers for PHP-PM.
34- $ docker run --rm --name ppm -e PPM_WORKER=16 - v `pwd`:/var/www -p 80:80 phppm/nginx:latest
37+ $ docker run -v `pwd`:/var/www -p 80:80 phppm/nginx --workers=16
3538```
3639
3740Docker compose
@@ -41,37 +44,28 @@ version: "3.1"
4144
4245services:
4346 ppm:
44- image: phppm/nginx:latest
47+ image: phppm/nginx
48+ command: --debug=1 --app-env=dev --static-directory=web/
4549 volumes:
4650 - ./symfony-app/:/var/www
4751 ports:
4852 - "80:80"
49- environment:
50- PPM_DEBUG: 1
51- PPM_APP_ENV: dev
52- PPM_STATIC: ./web/
5353```
5454
5555### Configuration
5656
5757You should configure PPM via the ppm.json in the root directory, which is withing the container mounted to
58- ` /var/www/ ` .
58+ ` /var/www/ ` . Alternatively, you can overwrite each option using the regular cli arguments.
5959
6060```
61- docker run phppm/ppm config --help
62- ```
63-
64- Additional you can use environment variables to change some configuration properties.
61+ # change the ppm.json within current directory
62+ docker run -v `pwd`:/var/www phppm/ppm config --help
6563
66- | Name | Default | Description |
67- | ------------- | ------------- | -------- |
68- | PPM_CONFIG | ppm.json | Which configuration to use |
69- | PPM_DEBUG | 0 | Use 1 to activate debugging (automatic reload of workers when source code changes) |
70- | PPM_APP_ENV | prod | The application environment |
71- | PPM_STATIC | | Use as root folder for nginx or standalone static file serving |
72- | PPM_WORKER | 8 | How many workers should be used to server php application. |
73-
74- Note, if you don't specify the environment variables above, the values from your ppm.json if present will be used.
64+ # not persisting config changes
65+ docker run -v `pwd`:/var/www -p 80:80 phppm/nginx --help
66+ docker run -v `pwd`:/var/www -p 80:80 phppm/nginx --workers=1 --debug 1
67+ docker run -v `pwd`:/var/www -p 80:80 phppm/nginx --c prod-ppm.json
68+ ```
7569
7670## Build image with own tools/dependencies
7771
0 commit comments