docker php cli code example
Example 1: php docker offical apache
FROM php:7.2-apache
COPY src/ /var/www/html/
Example 2: php-cli docker example
#index.php
<?php
echo "Hello world";
#Dockerfile
FROM php:7.4-cli
COPY . /usr/src/cli
WORKDIR /usr/src/cli
CMD [ "php", "./index.php" ]
then Run => docker build -t cli .
then Run => docker run -it cli