Skip to content

Commit dd221a8

Browse files
committed
Improve readme
1 parent 772648a commit dd221a8

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
[![Packagist Version](https://img.shields.io/packagist/v/blamebutton/laravel-docker-builder)](https://packagist.org/packages/blamebutton/laravel-docker-builder)
22
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/blamebutton/laravel-docker-builder/phpunit.yml)
33

4-
# Laravel Docker Build
4+
# Laravel Docker Builder
5+
6+
## Features
7+
8+
* Detect PHP version and extensions
9+
* Bundle assets with Vite.js or Laravel Mix
10+
* Separate NGINX and PHP-FPM images
11+
* Deployment examples for Kubernetes and Docker Compose
512

613
## Installation
714

@@ -28,6 +35,36 @@ DOCKER_PHP_TAG=laravel-app:php
2835

2936
## Usage
3037

38+
### Detect Configuration
39+
40+
```shell
41+
php artisan docker:generate --detect
42+
```
43+
44+
When `--detect` is passed to the `docker:generate` command, it will automatically detect the following requirements:
45+
46+
* PHP version, detected using the `php` version in your `composer.json`
47+
* PHP extensions, detected using the configuration of your project:
48+
* Cache driver: Redis, Memcached, APC
49+
* Database driver: MySQL, Postgres, SQL Server
50+
* Broadcasting driver: Redis
51+
* Queue driver: Redis
52+
* Session driver: Redis, Memcached, APC
53+
* Node package manager, detected using the existence of `package-lock.json` or `yarn.lock`
54+
* Node build tool, detected using the existence of `vite.config.js` or `webpack.mix.js`
55+
56+
### Manual Configuration
57+
3158
```shell
32-
php artisan docker:build
59+
php artisan docker:generate
3360
```
61+
62+
When no options are passed to `docker:generate`, a prompt is used to configure the project's requirements.
63+
64+
See all available options, and their supported values, by running `php artisan docker:generate --help`.
65+
66+
* `-p, --php-version` - PHP version for Docker image
67+
* `-e, --php-extensions` - PHP extensions (comma-separated) to include in Docker image
68+
* `-o, --optimize` - Run `php artisan optimize` on container start
69+
* `-m, --node-package-manager` - Install Node dependencies using NPM or Yarn
70+
* `-b, --node-build-tool` - Run Vite.js or Laravel Mix build step

src/Detector/NodeBuildToolDetector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class NodeBuildToolDetector extends FileDetector
99
protected function getPathMapping(): array
1010
{
1111
return [
12-
base_path('webpack.mix.js') => NodeBuildTool::MIX,
1312
base_path('vite.config.js') => NodeBuildTool::VITE,
13+
base_path('webpack.mix.js') => NodeBuildTool::MIX,
1414
];
1515
}
1616
}

0 commit comments

Comments
 (0)