Skip to content

Commit c29ce83

Browse files
Added note for additional config is requirement to support SSR for Laravel Application
2 parents 8709234 + 094ee8a commit c29ce83

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/applications/laravel.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,28 @@ stdout_logfile=/var/log/worker-inertia-ssr.log
269269
'''
270270
```
271271

272+
> [!NOTE]
273+
> Per default, Nixpacks runs the command `npm run build` to build your application during the deployment. Ensure that your `build` script in `package.json` contains the necessary build commands for server-side rendering. If you use one of the official starter kits including Inertia.js, change your scripts like this:
274+
> ```diff
275+
> "scripts": {
276+
>- "build": "vite build",
277+
>+ "build": "vite build && vite build --ssr",
278+
> "build:ssr": "vite build && vite build --ssr",
279+
> }
280+
> ```
281+
> Alternatively, if you don't want to adapt your default `build` script in `package.json`, you can add the correct build command for server-side rendering directly in your `nixpacks.toml` configuration file.
282+
>```diff
283+
>[phases.build]
284+
>cmds = [
285+
>+ "npm run build:ssr",
286+
> "mkdir -p /etc/supervisor/conf.d/",
287+
> "cp /assets/worker-*.conf /etc/supervisor/conf.d/",
288+
> "cp /assets/supervisord.conf /etc/supervisord.conf",
289+
> "chmod +x /assets/start.sh",
290+
> "..."
291+
> ]
292+
>```
293+
272294
### Persistent php.ini customizations
273295
274296
If you want to customize settings from your php.ini file, you can easily do so by using the `php_admin_value` directive and appending them to your `php-fpm.conf` file like this:

0 commit comments

Comments
 (0)