This image is built upon official Alpine PHP image enhanced with JavaScript and CSS minification utility based on matthiasmullie/minify. There are images for PHP 7.0, 7.1, 7.2 and 7.3 versions available, so choose the one according to your needs using the appropriate image tag.
In general you can use the image for any PHP related task, just run
docker run microsnail/php:$TAG <any php command>
However, there are two examples described in more details bellow.
If you work on more projects, you may have to cope with more versions of PHP. It would be mess to have them all installed on one PC, but containers can solve this in an elegant way.
If you use Visual Studio Code for your development, you can use this script to lint PHP files in your projects:
php.validate.executablePath to the scriptThe script is Windows batch, but it can be easily re-written to Unix/Linux shell script.
JavaScript and CSS files minification is a good practice for web pages and applications. There are a lot of minification utilities, our PHP image has one of them baked in. To use it run:
docker run --rm -v $HOSTDATADIRECTORY:/data:rw microsnail/php:$TAG php -f ms_minify.php /data $FILESTOBEMINIFIED
where
$HOSTDATADIRECTORY is directory containing your JavaScript and CSS files.$TAG is tag of image according to your needs$FILESTOBEMINIFIED is list to files to be minified (relative path to $HOSTDATADIRECTORYYou can find more information (like Dockerfile, helper scripts and contact) at Microsnail docker apps and utils page.
Content type
Image
Digest
Size
40.4 MB
Last updated
almost 8 years ago
docker pull microsnail/php:7.3