Skip to content

intellipharm-pty-ltd/docker-php-composer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Docker PHP Composer

PHP with Composer and HTML Tidy for DockerHub.

What is Composer?

Composer is a tool for dependency management in PHP, written in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

You can read more about Composer in the official documentation.

Getting Started

This repo contains at least one branch used to auto-build docker images on DockerHub.

  • master -> Builds image intellipharm/php-composer:latest
  • 7.x -> Builds image intellipharm/php-composer:7.x
  • 8.0 -> Builds image intellipharm/php-composer:8.0

Usage

Build the composer container and tag latest

docker build -t intellipharm/php-composer:latest .

Running the composer image is as simple as follows:

docker run --rm --interactive --tty \
--volume $PWD:/app \
--work-dir /app \
intellipharm/php-composer:latest install

Run composer install

docker run --rm -it \
-v ${DIR}/api:/app \
-w /app \
intellipharm/php-composer:latest install

Run composer update

docker run --rm -it \
-v ${DIR}/api:/app \
-w /app \
intellipharm/php-composer:latest update

Run composer dump-autoload

docker run --rm -it \
-v ${DIR}/api:/app \
-w /app \
intellipharm/php-composer:latest dump-autoload