gustavofreze/php

By gustavofreze

Updated 3 months ago

PHP Docker images.

Image
Languages & frameworks
Developer tools
2

100K+

gustavofreze/php repository overview

PHP

Quick reference

8.3-alpine, 8.3-alpine-fpm, 8.5-alpine 8.5-alpine-fpm

How to use this image?

CLI
Running directly
docker run --rm -v $(pwd):/var/www/html gustavofreze/php:8.5-alpine php your-script.php
Using as base image

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
FPM (with Nginx)

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

Extensions and tools added to this image.

Xdebug

Xdebug is an extension for PHP, and provides a range of features to improve the PHP development experience.

CodeSniffer

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.

Mess Detector

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

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.

Tag summary

Content type

Image

Digest

sha256:5cc80e689

Size

56.7 MB

Last updated

3 months ago

docker pull gustavofreze/php:8.5-alpine-fpm