Skip to content

Instantly share code, notes, and snippets.

@vladimino
Forked from andyshinn/composer.json
Last active February 19, 2019 10:21
Show Gist options
  • Save vladimino/4a9dca4b87fd14036be9272397ea6f04 to your computer and use it in GitHub Desktop.
Save vladimino/4a9dca4b87fd14036be9272397ea6f04 to your computer and use it in GitHub Desktop.
Docker Compose PHP Composer Example
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/lorenza/hello-world"
}
],
"require": {
"lorenza/hello-world": "dev-master"
}
}
app:
image: php:7
command: php -S 0.0.0.0:8000 /app/index.php
ports:
- "8000:8000"
volumes:
- .:/app
composer:
restart: 'no'
image: composer/composer:php7
command: install
volumes:
- .:/app
<?php
require 'vendor/autoload.php';
use HelloWorld\SayHello;
echo SayHello::world();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment