-
-
Notifications
You must be signed in to change notification settings - Fork 153
Refactor Laravel Autorun Script, adjust entrypoint behavior, contianer info improvements #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Laravel Autorun Script, adjust entrypoint behavior, contianer info improvements #511
Conversation
Huh, found out The optimize function has a new argument that'll be useful here from. v11.38. You can use Caveat here is using older versions of Laravel, they wouldn't support this. |
I think this might be ready for review / discussion now. I've added this into the script so that the I will mention, I'm not too well-versed in I'd say a future development of this could be that the optimization skips can be specified by a single environment variable, such as |
Thanks! I will take a peek once I get a moment. The challenging part is we cannot use Bash (/bin/bash), we must use Shell (/bin/sh) 🙃 I'll review and see what we have going on. I want to make sure the user experience is great for existing users (especally ones before Laravel 11) and the upgrade is seamless. I'll keep you posted! |
Made a few changes to make sure it has better compatibility with Shell (it does use POSIX right?), and with the script getting a bit bigger from adding the extra logic I decided to refactor the artisan calls into their own functions. I can reverse the refactoring if preferred. |
Co-authored-by: Paul <[email protected]>
Thanks! Yes, it should be /bin/sh and POSIX compliant. I'll review sometime (likely next week) as this week has been a busy client week. I greatly appreciate you tackling this! I also just approved the workflow, so hopefully it will build some preliminary images to test with on DockerHub |
docs/content/docs/7.reference/1.environment-variable-specification.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Erik Gaal <[email protected]>
Co-authored-by: Erik Gaal <[email protected]>
Co-authored-by: Erik Gaal <[email protected]>
- Update entrypoint script to use subshell for script execution - Enhance logging and error reporting for initialization scripts - Remove "Don't use exit 0" section from documentation - Modify exit handling in initialization scripts to preserve environment
Clarify shell script compatibility requirements for different Linux distributions and operating systems, specifying separate guidelines for /bin/sh and /bin/bash scripts
- Improve welcome message layout and readability - Add memory and upload limit information - Include Docker CMD in runtime section - Replace `return 0` with `exit 0` for script termination - Update links and formatting for better user experience
- Add DOCKER_CMD environment variable to capture the original Docker command - Enable easier access to the original command in subsequent initialization scripts
- Add `AUTORUN_DEBUG` environment variable for detailed Laravel automation logging - Implement comprehensive Laravel version detection and compatibility checks - Improve optimization and migration scripts with granular control - Update documentation to reflect new automation features
@aSeriousDeveloper: Thank you SO MUCH for this PR. It wasn't until I saw your PR is when I realized how UGLY my Laravel automations script has become. I took what you had and added a lot more flexibility, sanity checks, modularity, etc. I feel pretty good where this is at so far in my firsts tests, but I have some things to double check before I merge this into 3.6. Feel free to take a look at what I have going so far and let me know your thoughts. |
The automation script really did receieve an overhaul 😸 EDIT: whoops, forgot that it would reset the test suite :z apologies |
- Improve description and clarity of Laravel Automations script - Add comprehensive table of environment variables and their functions - Update links to Laravel documentation to version 12.x - Enhance explanations for each Laravel artisan command - Refactor content to provide more detailed and user-friendly information
- Document troubleshooting steps for AUTORUN script - Explain how to enable debug output with environment variables - Provide best practices for preventing AUTORUN script issues
- Add conditional debug logging for NGINX + PHP-FPM health checks - Display more informative message when service is not yet online - Only show HTTP status code when debug mode is enabled
- Add explanation for disabling the `optimize` command - Highlight the benefits of using the `optimize` command - Improve formatting of section headers for better readability
AUTRORUN_LARAVEL_OPTIMIZE
to run Laravel's artisan optimize
command.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!
What this PR does
This PR started as a simple report by @aSeriousDeveloper, and then the scope was expanded by @jaydrogers 😃
Original Comment by @aSeriousDeveloper
As we started working through this process, many other areas were discovered to be improved upon as well.
🤩 What's new
php artisan optimize
support to the Laravel Automations scriptAUTORUN_DEBUG
environment variable to help diagnose issues with Laravel Automationsentrypoint.d
scripts so we can gracefully handleexit 0
in a entrypoint script🐛 Bug fixes
/run
directory was not being changed when runningdocker-php-serversideup-set-file-permissions