/docker-php-composer

Composer builder image with PHP 7.x, based on Alpine Linux with S6 overlay

Primary LanguageDockerfileGNU General Public License v3.0GPL-3.0

docker-php-composer

Latest release Travis build status Docker build status Docker Hub downloads

An image with PHP and Composer, based on Alpine Linux with S6 overlay. Can be used as builder image by using Composer to install dependencies etc. and copying the result to the final image, or as a base image for you own custom images.

Versions

Image PHP Composer Info
roeldev/php-composer:7.1-latest 7.1.28 1.8.6 mb-71-img
roeldev/php-composer:7.2-latest 7.2.17 1.8.6 mb-72-img
roeldev/php-composer:7.3-latest 7.3.4 1.8.6 mb-73-img
roeldev/php-composer:7.4-rc-latest 7.4.0alpha1 1.8.6 mb-74-img

Usage

Builder image

ARG PHP_VERSION="7.3"
FROM roeldev/php-composer:${PHP_VERSION} as builder

COPY local/path/to/project /project/folder
WORKDIR /project/folder

RUN set -x \
 # install required php packages
 && composer install \
        --no-dev \
        --no-progress \
        --no-suggest \
        --no-interaction \
 && composer dumpautoload -o

# create actual image
FROM roeldev/php-cli:${PHP_VERSION}
COPY --from=builder /project/folder /actual/project

Links

License

GPL-3.0+ © 2019 Roel Schut