This is an image used for developing with Laravel and exposes a PHP-FPM running on port 9000. The current php.ini has all error reporting enabled.
Current extensions installed are:
Additionally, Composer is installed as well and is located as globally accessible.
Run composer install in current directory (use %cd‰ instead of $(pwd) if on Windows):
$ docker run -it -v $(pwd):/app -w /app repox/laravel-dev-php:latest composer install
Run composer require laravel/sanctum in current directory:
$ docker run -it -v $(pwd):/app -w /app repox/laravel-dev-php:latest composer require laravel/sanctum
Run PHP file:
$ docker run -it -v $(pwd):/app -w /app repox/laravel-dev-php:latest php file.php
Show PHP version:
$ docker run -it repox/laravel-dev-php:latest php -v
docker-compose.ymlThis image is best suited to be used in a Docker Compose setup.
An example file could look like this:
version: '3.8'
services:
php:
image: repox/laravel-dev-php:8.0
volumes:
- .:/var/www/html
working_dir: /var/www/html
nginx:
image: nginx
ports:
- "80:80"
volumes:
- .:/var/www/html
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: homestead
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
composer:
image: repox/laravel-dev-php:8.0
volumes:
- .:/var/www/html
working_dir: /var/www/html
entrypoint: ['/usr/bin/composer']
artisan:
image: repox/laravel-dev-php:8.0
volumes:
- .:/var/www/html
working_dir: /var/www/html
entrypoint: ['php', '/var/www/html/artisan']
The above is just an example and not a working setup.
It should illustrate how you can utilize the images to different needs.
To use composer and artisan commands inside the same containerized network, you can run commands like the following.
Syntax is docker-compose run {servicename} {arguments}:
$ docker-compose run artisan migrate
$ docker-compose run artisan queue:work --once
$ docker-compose run composer update --prefer-dist
$ docker-compose run composer dump
Content type
Image
Digest
sha256:484e558bd…
Size
150.4 MB
Last updated
over 3 years ago
docker pull repox/laravel-dev-php