Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bkuhl/php
A php container with Laravel dependencies
https://github.com/bkuhl/php
docker laravel php
Last synced: 3 months ago
JSON representation
A php container with Laravel dependencies
- Host: GitHub
- URL: https://github.com/bkuhl/php
- Owner: bkuhl
- License: mit
- Created: 2017-05-14T17:22:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-30T12:11:39.000Z (about 1 year ago)
- Last Synced: 2023-10-30T13:27:38.357Z (about 1 year ago)
- Topics: docker, laravel, php
- Language: Dockerfile
- Size: 53.7 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP
[![Docker Pulls](https://img.shields.io/docker/pulls/bkuhl/php.svg)](https://hub.docker.com/r/bkuhl/php)
This container is intended to run Laravel application's queues, cron, etc. and thus comes with a few items to assist:
* [Composer](https://getcomposer.org)
* PHP Extensions
* [mbstring](http://php.net/manual/en/book.mbstring.php)
* [pdo_mysql](http://php.net/manual/en/ref.pdo-mysql.php)
* [gd](http://php.net/manual/en/book.image.php)
* [pcntl](http://php.net/manual/en/book.pcntl.php) (Required for queue workers as of Laravel 5.3)
**[spatie/laravel-backup Dependencies](https://github.com/spatie/laravel-backup)**
* PHP extension [zip](http://php.net/manual/en/book.zip.php)
* `mysql-client` for `mysqldump` support
For a container to run nginx/fpm for Laravel applications, check out [bkuhl/fpm-nginx](https://github.com/bkuhl/fpm-nginx).
# Crons, Queue Workers and MigrationsOverwrite the container's default command to perform various Laravel tasks.
* Cron container: use command `crond -f -d 8`
* Queue worker container: use command `php /var/www/html/artisan queue:work --sleep=3 --tries=3 --timeout=0`
* Migrations container: use command `php /var/www/html/artisan migrate --force`
## Example Dockerfile```
FROM bkuhl/php:8WORKDIR /var/www/html
# Copy the application files to the container
ADD --chown=www-data:www-data . /var/www/htmlUSER www-data
# production-ready dependencies
RUN composer install --no-interaction --optimize-autoloader --no-dev --no-cache --prefer-dist
```