https://github.com/shipping-docker/php-composer
A small container with latest stable PHP, Git, and Composer
https://github.com/shipping-docker/php-composer
Last synced: 6 months ago
JSON representation
A small container with latest stable PHP, Git, and Composer
- Host: GitHub
- URL: https://github.com/shipping-docker/php-composer
- Owner: shipping-docker
- Created: 2017-10-18T15:32:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T09:01:48.000Z (almost 3 years ago)
- Last Synced: 2025-01-07T15:26:45.709Z (11 months ago)
- Language: Dockerfile
- Size: 9.77 KB
- Stars: 20
- Watchers: 5
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## PHP-Composer
This takes the latest stable official PHP Docker images (currently `php:7.2-cli`, `php:7.3-cli`, `php:7.4-cli`), and adds in Git, Composer, Zip, as well as common PHP modules.
This is best used for when you do not have PHP 7+ installed on your machine, and don't want to install it. In such a case, you may run into a chicken and egg issue with [Vessel](https://vessel.shippingdocker.com) where you cannot start a new Laravel project, nor get [Vessel](https://vessel.shippingdocker.com), until you have PHP 7, but you won't have PHP 7 until you install and setup Vessel.
## Usage
To create a new Laravel project, or run any Composer command, run the following:
```bash
cd ~/Path/To/Projects
# Create a new Laravel app
docker run --rm \
-v $(pwd):/opt \
-w /opt \
shippingdocker/php-composer:latest \
composer create-project laravel/laravel my-app
# Add Vessel to that new app, or run any composer command
cd ~/Path/To/Projects/my-app
docker run --rm \
-v $(pwd):/opt \
-w /opt \
shippingdocker/php-composer:latest \
composer require shipping-docker/vessel
```
You may want to replace `$(pwd)` with your actual file path if `$(pwd)` does not correctly expand to your current working directory.