Skip to content

factorysh/docker-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4215803 · Apr 15, 2022
Mar 31, 2022
Apr 20, 2021
Mar 31, 2022
Apr 6, 2022
Jun 15, 2021
Jan 26, 2022
Nov 4, 2021
Mar 28, 2022
Jan 26, 2022
Nov 4, 2021
Oct 15, 2020
Apr 6, 2022
Nov 3, 2020
Oct 17, 2019
Jun 2, 2021
Jun 15, 2021
Aug 10, 2020
Mar 31, 2022
Aug 10, 2020
Jan 2, 2020
Feb 24, 2021
Jun 15, 2021
Apr 15, 2022

Repository files navigation

PHP docker images by bearstech

3 variants of PHP7 from Debian :

All variants are available as tag for PHP 7.0, 7.1, 7.2 and 7.3

Dockerfiles

Dockerfiles are available at https://github.com/factorysh/docker-php

Usage

docker run --rm bearstech/php:7.3
docker run --rm bearstech/php-cli:7.3
docker run --rm bearstech/php-composer:7.3

Composer

In bearstech/php-composer images, composer is the latest stable version : 2.x now. The composer1 command is here to help your migration to Composer 2, composer1 version 1.10.x.

User

fpm images needs a specific user, not root. In your Dockerfile, use something like :

RUN useradd alice --shell /bin/bash
COPY www /var/www/web
USER alice

If you are using a volume, be carefuls with uids :

ARG UID=1001
RUN useradd alice --uid ${UID} --shell /bin/bash
COPY www /var/www/web
USER alice

and build the image with a build-arg like :

--build-arg UID=`id -u`

Session

Default session handler is a file.

If you set SESSION_REDIS_URL, the will use Redis as a session handler.

See https://github.com/phpredis/phpredis

Entrypoint.d

All php images implements the concept of entrypoint.d.

With entrypoint.d user can trigger custom actions before application startup (entrypoint).

Just put your scripts and executable in the /entrypoint.d directory of your php containers. On startup, each executable file inside this directory will be run in an independent bash process.

Entrypoint.d runs files marked as executable, in alphabetical order. You can look for an example inside /entrypoint.d

Since each container runs entrypoint.d scripts, this is not the recommanded way to run migrations : if you have N replicas, migrations will be run N times

Releases

No releases published

Packages

No packages published

Languages