Skip to content

Instantly share code, notes, and snippets.

Last active April 27, 2022 23:05
What would you like to do?
Docker Compose PHP Composer Example
"require": {
"mfacenet/hello-world": "v1.*"
restart: 'yes'
image: php:7
command: php -S /app/index.php
- "8000:8000"
- .:/app
restart: 'no'
image: composer/composer:php7
command: install
- .:/app
require 'vendor/autoload.php';
use HelloWorld\SayHello;
echo SayHello::world();
Copy link

killrazor commented Jun 21, 2018

Restart policy of 'yes' is not valid (at least now) docker restart policies.
Also, I had to use docker-compose up to install the container. appears that the remote repository no longer exists.

[tyler.christian@ThisOne my-dir]$ git clone
Cloning into 'hello-world'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Copy link


It just works (TM)

Copy link

Thanks, worked for me!

Copy link

@andyshinn How does it work with PHP 7.2?

Copy link

Is there some error with PHP 7.2? I don't use PHP daily so I am not sure what the difference might be.

Copy link

samo29 commented Feb 19, 2020

Perfect! thanks for share!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment