├── Dockerfile └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM likol1227/php7 2 | 3 | RUN php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/local/bin --filename=composer 4 | 5 | RUN wget https://github.com/puli/cli/releases/download/1.0.0-beta9/puli.phar && chmod +x puli.phar && mv puli.phar /usr/local/bin/puli 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP 7 Docker image 2 | 3 | This is yet another PHP 7 Docker image except this one contains Composer and Puli. Both are installed as Phars globally (`composer` and `puli` commands). 4 | 5 | ## Usage 6 | 7 | With Docker: 8 | 9 | ``` 10 | docker run mnapoli/php7-cli php -v 11 | ``` 12 | 13 | With Docker Compose: 14 | 15 | ```yml 16 | app: 17 | image: mnapoli/php7-cli 18 | ... 19 | ``` 20 | 21 | Here is an example to mount the local directory and run [PHP's built-in webserver](http://php.net/manual/en/features.commandline.webserver.php) for developing locally: 22 | 23 | ```yml 24 | # docker-compose.yml 25 | app: 26 | image: mnapoli/php7-cli 27 | ports: 28 | - "8080:8000" 29 | volumes: 30 | - .:/app 31 | working_dir: /app 32 | command: "php -S 0.0.0.0:8000" 33 | ``` 34 | 35 | Running `docker-compose up` will start the webserver. The application will be accessible at http://localhost:8080. 36 | 37 | ## Composer and Puli 38 | 39 | With Docker: 40 | 41 | ``` 42 | docker run mnapoli/php7-cli composer --version 43 | ``` 44 | 45 | With Docker Compose (and the `docker-compose.yml` example from above): 46 | 47 | ``` 48 | # Composer update 49 | docker-composer run app composer update 50 | # Puli build 51 | docker-composer run app puli build 52 | ``` 53 | --------------------------------------------------------------------------------