Skip to content

Commit 3eca0ae

Browse files
committed
Add publish command for config file
1 parent 7bf7de8 commit 3eca0ae

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ DOCKER_PHP_TAG=laravel-app:php
2828
DOCKER_NGINX_TAG=laravel-app:nginx DOCKER_PHP_TAG=laravel-app:php vendor/bin/docker-build
2929
```
3030

31+
### Option 3: Config File
32+
33+
```shell
34+
php artisan vendor:publish --provider="BlameButton\LaravelDockerBuilder\DockerServiceProvider"
35+
```
36+
3137
## Usage
3238

3339
Set the `DOCKER_NGINX_TAG` and `DOCKER_PHP_TAG` environment variables and run:

config/docker-build.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
use Illuminate\Support\Str;
4+
5+
$tag = Str::slug(env('APP_NAME', 'laravel'));
6+
7+
return [
8+
'tags' => [
9+
'nginx' => env('DOCKER_NGINX_TAG', "$tag:nginx"),
10+
'php' => env('DOCKER_PHP_TAG', "$tag:php"),
11+
],
12+
];

src/DockerServiceProvider.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ public function boot(): void
1616
DockerGenerateCommand::class,
1717
]);
1818
}
19+
20+
$this->publishes([
21+
__DIR__ . '/../config/docker-build.php' => config_path('docker-build.php'),
22+
]);
23+
24+
$this->mergeConfigFrom(
25+
__DIR__ . '/../config/docker-build.php', 'docker-builder',
26+
);
1927
}
2028

2129
public static function getPackagePath(string $path = null): string

0 commit comments

Comments
 (0)