Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 1.85 KB

README.md

File metadata and controls

56 lines (36 loc) · 1.85 KB

All in One PHP Container

GitHub Actions Workflow Status PHP

Mostly used PHP extentions are pre installed and Binaries are stripped and multi-staged making this image to be smaller in size by about 1/3

Variants

  • apache: Based on Apache and serves your code using Apache2
  • nginx: Based on PHP FPM and NGINX
  • fpm: Based on PHP FPM can be used as FactCGI server
  • cli: Contains no builtin webserver (Swoole is pre-installed)

Available Images

  • ghcr.io/parmincloud/containers/php:php8.1-nginx
  • ghcr.io/parmincloud/containers/php:php8.1-apache
  • ghcr.io/parmincloud/containers/php:php8.1-fpm
  • ghcr.io/parmincloud/containers/php:php8.1-cli

Replace 8.1 with your PHP Version (8.1, 8.2, 8.3 and 8.4 is available)

We are supporting versions that are listed here

ENVs

  • DOCUMENT_ROOT: Defaults to /var/www/html and sets root dir of servers (works on apache and nginx)

    In laravel you might set it to /var/www/html/public

Example Usage

Containerfile/Dockerfile:

FROM ghcr.io/parmincloud/containers/php:php8.1-nginx

COPY composer.* /var/www/html/
COPY package.* /var/www/html/
RUN yarn install # npm is also available
RUN composer install --no-scripts --no-autoloader --no-interaction --prefer-dist

COPY . .
RUN composer dump-autoload --optimize

Known Issues

  • Multi Platform builds are disabled due to this issue

FAQ