Skip to content

Docker files for PHP-PM

License

Notifications You must be signed in to change notification settings

nevrending/php-pm-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Workflow Status Docker Version Docker Pulls Docker Image Size (latest by date)

NevREnding's Fork of PHP-PM Docker

Noteable Changes and Differences

  • Built with the latest PHP-PM and HttpKernel.
  • Base image is Alpine 3.14.
  • New laravel tag/image flavour.
  • PHP8.0 for nginx and laravel tag/image flavours.
  • Optimized NGiNX configurations.

PHP-PM Docker

You can use PHP-PM using Docker. We provide you several images always with PHP-PM and PHP7 pre-installed.

Images

PHP7.4

PHP8.0

Examples

# change into your project folder first
cd your/symfony-project/

# see what php-pm binary can do for you.
$ docker run -v `pwd`:/var/www/ nevrending/phppm:ppm-latest --help
$ docker run -v `pwd`:/var/www/ nevrending/phppm:ppm-latest config --help

# with nginx as static file server
$ docker run -v `pwd`:/var/www -p 8080:80 nevrending/phppm:nginx-latest

# with php-pm as static file server (dev only)
$ docker run -v `pwd`:/var/www -p 8080:80 nevrending/phppm:standalone-latest

# use `PPM_CONFIG` environment variable to choose a different PPM config file.
$ docker run  -v `pwd`:/var/www -p 80:80 nevrending/phppm:nginx-latest -c ppm-prod.json

# enable file tracking, to automatically restart PPM when PHP source changed
$ docker run -v `pwd`:/var/www -p 80:80 nevrending/phppm:nginx-latest --debug=1 --app-env=dev

# change static file directory. PPM_STATIC relative to mounted /var/www/.
$ docker run -v `pwd`:/var/www -p 80:80 nevrending/phppm:nginx-latest --static-directory=web/

# Use 16 threads/workers for PHP-PM.
$ docker run -v `pwd`:/var/www -p 80:80 nevrending/phppm:nginx-latest --workers=16

Docker Compose

version: "3.1"

services:
  ppm:
    image: nevrending/phppm:nginx-latest
    command: --debug=1 --app-env=dev --static-directory=web/
    volumes:
      - ./symfony-app/:/var/www
    ports:
      - "80:80"

Configurations

You can configure PPM via the ppm.json file in the root directory, which is within the container mounted to /var/www/. Alternatively, you can overwrite each option using the regular CLI arguments.

# change the ppm.json within current directory
docker run -v `pwd`:/var/www nevrending/phppm:ppm-latest config --help

# not persisting config changes
docker run -v `pwd`:/var/www -p 80:80 nevrending/phppm:nginx-latest --help
docker run -v `pwd`:/var/www -p 80:80 nevrending/phppm:nginx-latest --workers=1 --debug 1
docker run -v `pwd`:/var/www -p 80:80 nevrending/phppm:nginx-latest --c prod-ppm.json

Build Image With Your Own Tools/Dependencies

If your application requires additional PHP modules or other tools and libraries in your container, you can use our image as base. We use lightweight Alpine Linux.

FROM nevrending/phppm:nginx-latest

RUN apk --no-cache add git
RUN apk --no-cache add ca-certificates wget

# whatever you need
docker build -f Dockerfile -t my-repo/my-image .

Building With Make

$ make VERSION=dev-master HTTP_VERSION=dev-master
$ make push-all

Recommendations:

  • VERSION=2.2.2
  • HTTP_VERSION=2.0.6

License

License: MIT

About

Docker files for PHP-PM

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 59.8%
  • Makefile 22.9%
  • Shell 17.3%