Multiple PHP docker containers, with docker-compose
- Clone project
git clone https://github.com/one4two/docker-multiphp.git
- Move to project directory
- Run
docker-compose up -d
- Make script executable
sudo chmod +x ./get-composer.sh
- Run
./get-composer.sh
Install package
docker exec -it php56 /bin/sh -c 'php composer.phar require <vendor>/<package>'
USAGE:
docker exec -it php56 /bin/sh -c 'php run.php'
docker exec -it php74 /bin/sh -c 'php run.php'
docker exec -it php81 /bin/sh -c 'php run.php'