https://github.com/nathanjms/laravel-coolify-example
Example laravel app to test with Coolify, and (optionally) Laravel Horizon
https://github.com/nathanjms/laravel-coolify-example
coolify laravel laravel-framework laravel-horizon
Last synced: about 1 month ago
JSON representation
Example laravel app to test with Coolify, and (optionally) Laravel Horizon
- Host: GitHub
- URL: https://github.com/nathanjms/laravel-coolify-example
- Owner: Nathanjms
- Created: 2024-09-15T13:32:37.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-15T15:32:57.000Z (8 months ago)
- Last Synced: 2025-03-26T04:35:32.317Z (2 months ago)
- Topics: coolify, laravel, laravel-framework, laravel-horizon
- Language: PHP
- Homepage:
- Size: 167 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laravel Coolify Example with Horizon
The magic comes from the `nixpacks.toml` file, which was based on the one provided by [@marcfowler](https://github.com/marcfowler) at https://github.com/coollabsio/coolify/discussions/2156.
Note: If you do not need horizon, then you may be able to further simplify this by using `nixpacks.no-horizon.toml` (renaming to `nixpacks.toml`) instead.
I've also added opcache, but to be honest am unsure if it's working (or needed here).
## Steps
### Step 1
Include the `nixpacks.toml` (or `nixpacks.no-horizon.toml` renamed to `nixpacks.toml`) in your root directory, then one of the following:
### Step 2
The `nixpacks` has a `[postbuild]` step to handle the cache:clear and the artisan:migrate commands, but to get supervisor to run (so we get horizon), you can either override the default `[start]`'s `cmd` with the one provided by Nixpacks and add the command to start supervisor:
```
[start]
cmd = 'node /assets/scripts/prestart.mjs /assets/nginx.template.conf /nginx.conf && (supervisord -c /etc/supervisord.conf & php-fpm -y /assets/php-fpm.conf & nginx -c /nginx.conf)'
```However, if Nixpacks change this command in the future (unsure how likely this is), this will not update.
Instead, we can do the following to run supervisor post-build:
Add the following to the post-deployment commands section of the project on Coolify dashboard:
```
supervisord -c /etc/supervisord.conf
```