Skip to content

Commit 30bad9a

Browse files
authored
Update laravel.md
Added additional configuration to the Laravel example nixpacks.toml to work better out of the box. Automatically generating necessary directories, changing permissions, running migrations and running queue. This will make the example environment work for a more broad range of Laravel application and closer reflect how deployments are handled on other popular hosting services.
1 parent f72c890 commit 30bad9a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/applications/laravel.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,27 @@ nixPkgs = ["...", "python311Packages.supervisor"]
4848

4949
[phases.build]
5050
cmds = [
51+
"mkdir -p /var/log",
52+
"mkdir -p /app/storage/framework/{views,cache,sessions}",
53+
"mkdir -p /app/bootstrap/cache",
5154
"mkdir -p /etc/supervisor/conf.d/",
5255
"cp /assets/worker-*.conf /etc/supervisor/conf.d/",
5356
"cp /assets/supervisord.conf /etc/supervisord.conf",
5457
"chmod +x /assets/start.sh",
58+
"chown -R www-data:www-data /var/log /app/storage /app/bootstrap/cache"
5559
"..."
5660
]
5761

62+
[phases.postbuild]
63+
cmds = [
64+
"php artisan migrate --force",
65+
"npm run build",
66+
"php artisan config:cache",
67+
"php artisan route:cache",
68+
"php artisan queue:work"
69+
]
70+
dependsOn = ["build"]
71+
5872
[start]
5973
cmd = '/assets/start.sh'
6074

0 commit comments

Comments
 (0)