Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Before diving into making local development changes, there're some to-do's to ge

1. Clone the repository
2. Get the repo dependencies with `composer install`
3. And, just in case you ever find an error about files not being available, you might be able to fix this with providing the proper permission to the box package used by Laravel Zero framework: `chmod 755 vendor/laravel-zero/framework/bin/box`.
3. If you run into any issues, find the `Getting Past Hurdles` section below for common solutions

Then, yes. After set up, you can make your changes!

Expand All @@ -111,6 +111,16 @@ Simply run the build command:
```
php dockerfile-laravel app:build
```

### Getting Pass Hurdles

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Getting Past"

Below are some common problems with local set up and building

#### Files Not available
If you ever find an error about files not being available, you might be able to fix this with providing the proper permission to the box package used by Laravel Zero framework: `chmod 755 vendor/laravel-zero/framework/bin/box`.

#### Build Compile Error
If your build runs into a compile error, try upgrading to the next Laravel Zero Version, see [upgrade guide](https://laravel-zero.com/docs/upgrade#upgrade-11.0.0).

#### Build View Changes
If changes were made in any of the view files, make sure to clear the cached views( For now, this can be done by manually deleting the cached files ). The path to where the views' caches are stored is configured in `config/view.php`.

Expand All @@ -125,6 +135,12 @@ Once you've successfully built your changes, you have to test how it turned out.
```
And that's it! You should now see a fresh Dockerfile available for your project.

### Testing the Dockerfile generated Locally
1. Make sure that the necessary files that are needed locally is available to the image by reviewing the .dockerignore and .gitignore
2. Build the image with `docker build -t <image-name> .`
3. Run the image with `docker run -it -p 8080:8080 <image-name>`


## Test Cases
There are two general purpose test cases in `tests/Feature/GenerateCommandTest.php`:

Expand All @@ -143,6 +159,10 @@ There are two general purpose test cases in `tests/Feature/GenerateCommandTest.p

These test cases are used to make sure new changes would not break existing features of the `generate` command. These can be run through `./vendor/bin/pest`.

## Note on Testcases
If new template changes are made, then it would follow that the generated test template files that are used to test the generated files would not match with the generated files. It goes to say, there are two options in resolving this:
- Manually update each template file to apply the new changes
- OR automatically override the test templates with the new files generated by setting the .env variable `OVERRIDE_TEST_REFERENCES=true`

## Contribution
Once you've cooked up and tested your local changes, you can make a Pull Request to request its inclusion in this repository. ( BONUS points if you add a test case for your change! )
Expand Down
Binary file modified builds/dockerfile-laravel
Binary file not shown.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"laravel/pint": "^1.13",
"mockery/mockery": "^1.6",
"pestphp/pest": "^2.22",
"illuminate/view": "^10.0",
"laravel-zero/framework": "^10.2",
"illuminate/view": "^11.0",
"laravel-zero/framework": "^11.0",
"phpspec/php-diff": "^1.1",
"nunomaduro/termwind": "^1.15.1"
"nunomaduro/termwind": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading