Skip to content

Example laravel app to test with Coolify, and (optionally) Laravel Horizon

Notifications You must be signed in to change notification settings

Nathanjms/laravel-coolify-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Coolify Example with Horizon

The magic comes from the nixpacks.toml file, which was based on the one provided by @marcfowler at coollabsio/coolify#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

Screenshot

About

Example laravel app to test with Coolify, and (optionally) Laravel Horizon

Topics

Resources

Stars

Watchers

Forks

Languages