PHP Docker images.
100K+
8.3-alpine,
8.3-alpine-fpm,
8.5-alpine
8.5-alpine-fpm
docker run --rm -v $(pwd):/var/www/html gustavofreze/php:8.5-alpine php your-script.php
Create a Dockerfile in your project:
FROM gustavofreze/php:8.5-alpine
COPY . /var/www/html
WORKDIR /var/www/html
RUN composer install --no-dev --optimize-autoloader
CMD ["php", "your-script.php"]
Build and run:
docker build -t my-php-app .
docker run --rm my-php-app
Create a docker-compose.yml:
services:
php:
image: gustavofreze/php:8.5-alpine-fpm
volumes:
- ./src:/var/www/html
expose:
- "9000"
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./src:/var/www/html
- ./nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php
Run:
docker compose up -d
Extensions and tools added to this image.
Xdebug is an extension for PHP, and provides a range of features to improve the PHP development experience.
CodeSniffer is a set of two PHP scripts. The main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
PHPMD is a mature project and provides a diverse set of pre-defined rules to detect code smells and possible errors within the analyzed source code.
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on, and it will manage (install/update) them for you.
Content type
Image
Digest
sha256:5cc80e689…
Size
56.7 MB
Last updated
3 months ago
docker pull gustavofreze/php:8.5-alpine-fpm