Skip to content
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

Bump PNPM from 7 to 8 #1242

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion laravel/advanced-guides/using-inertia-ssr.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
_________________________________________________

## Dockerfile Changes
[Inertia SSR](https://inertiajs.com/server-side-rendering) requires a background [Node process](https://inertiajs.com/server-side-rendering#:~:text=Node%20must%20be%20available) that will render requested html pages. You'll have to update Fly.io's generated `Dockerfile` for your Laravel app in order to include support for `Node`. You can follow any of the below options to include `Node`:

Check warning on line 15 in laravel/advanced-guides/using-inertia-ssr.html.md

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Spelling] Is 'html' a typo? Raw Output: {"message": "[Fly.Spelling] Is 'html' a typo?", "location": {"path": "laravel/advanced-guides/using-inertia-ssr.html.md", "range": {"start": {"line": 15, "column": 206}}}, "severity": "INFO"}

Check warning on line 15 in laravel/advanced-guides/using-inertia-ssr.html.md

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.WordList] Consider using 'to' instead of 'in order to'. Raw Output: {"message": "[Fly.WordList] Consider using 'to' instead of 'in order to'.", "location": {"path": "laravel/advanced-guides/using-inertia-ssr.html.md", "range": {"start": {"line": 15, "column": 293}}}, "severity": "INFO"}

### Option 1: Quick copy of Node to Final Image
The Laravel fly-scanner already generates a Dockerfile that makes use of a `Node` image, but uses a different final image. The quickest way to include Node into your app's final image, is to copy over the `Node` image's `node` binaries and generated `node_modules` to the final `fly-laravel` image:
Expand Down Expand Up @@ -45,7 +45,7 @@
yarn install --frozen-lockfile; \
yarn $ASSET_CMD; \
elif [ -f "pnpm-lock.yaml" ]; then \
corepack enable && corepack prepare pnpm@latest-7 --activate; \
corepack enable && corepack prepare pnpm@latest-8 --activate; \
pnpm install --frozen-lockfile; \
pnpm run $ASSET_CMD; \
elif [ -f "package-lock.json" ]; then \
Expand Down Expand Up @@ -90,9 +90,9 @@
app=""
ssr="php /var/www/html/artisan inertia:start-ssr"
```
Adding the SSR process above creates a new machine specially for your SSR server. You'll now have separate machines for your web app, and ssr server:

Check warning on line 93 in laravel/advanced-guides/using-inertia-ssr.html.md

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machine' instead of 'machine'. Raw Output: {"message": "[Fly.Machine] Use 'Machine' instead of 'machine'.", "location": {"path": "laravel/advanced-guides/using-inertia-ssr.html.md", "range": {"start": {"line": 93, "column": 43}}}, "severity": "INFO"}

Check warning on line 93 in laravel/advanced-guides/using-inertia-ssr.html.md

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machines' instead of 'machines'. Raw Output: {"message": "[Fly.Machine] Use 'Machines' instead of 'machines'.", "location": {"path": "laravel/advanced-guides/using-inertia-ssr.html.md", "range": {"start": {"line": 93, "column": 107}}}, "severity": "INFO"}

Check warning on line 93 in laravel/advanced-guides/using-inertia-ssr.html.md

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Spelling] Is 'ssr' a typo? Raw Output: {"message": "[Fly.Spelling] Is 'ssr' a typo?", "location": {"path": "laravel/advanced-guides/using-inertia-ssr.html.md", "range": {"start": {"line": 93, "column": 139}}}, "severity": "INFO"}
![Machines created for the processes](/docs/images/laravel-app-ssr-vms.png)
<small>Notice there are four machines above? The two machines listed at the bottom are back ups.</small>

Check warning on line 95 in laravel/advanced-guides/using-inertia-ssr.html.md

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machines' instead of 'machines'. Raw Output: {"message": "[Fly.Machine] Use 'Machines' instead of 'machines'.", "location": {"path": "laravel/advanced-guides/using-inertia-ssr.html.md", "range": {"start": {"line": 95, "column": 29}}}, "severity": "INFO"}

Check warning on line 95 in laravel/advanced-guides/using-inertia-ssr.html.md

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machines' instead of 'machines'. Raw Output: {"message": "[Fly.Machine] Use 'Machines' instead of 'machines'.", "location": {"path": "laravel/advanced-guides/using-inertia-ssr.html.md", "range": {"start": {"line": 95, "column": 53}}}, "severity": "INFO"}

Now that you have more than one process group for your Fly.io app, you'll have to make sure that the [`[http_service]`](/docs/reference/configuration/#the-http_service-section) is properly mapped to your `app` process. Update your `fly.toml`'s `http_service` section with the `app` process:
```toml
Expand All @@ -108,7 +108,7 @@


### Web and SSR Communication
The SSR server will be created as a separate VM from your web app. You'll have to configure your Laravel web VM to [talk with it](https://community.fly.io/t/process-group-aware-internal-dns-route-between-processes-with-ease/13063/4). To do so, first revise the `fly.toml` file to include an `SSR_URL` that will contain the ssr process' [.internal address](https://fly.io/docs/reference/private-networking/#fly-internal-addresses) routed to SSR's applicable port ( in the case below, 13714):

Check warning on line 111 in laravel/advanced-guides/using-inertia-ssr.html.md

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Spelling] Is 'ssr' a typo? Raw Output: {"message": "[Fly.Spelling] Is 'ssr' a typo?", "location": {"path": "laravel/advanced-guides/using-inertia-ssr.html.md", "range": {"start": {"line": 111, "column": 324}}}, "severity": "INFO"}

Check warning on line 111 in laravel/advanced-guides/using-inertia-ssr.html.md

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Spelling] Is 'SSR's' a typo? Raw Output: {"message": "[Fly.Spelling] Is 'SSR's' a typo?", "location": {"path": "laravel/advanced-guides/using-inertia-ssr.html.md", "range": {"start": {"line": 111, "column": 441}}}, "severity": "INFO"}
```.env
[env]
SSR_URL="ssr.process.<yourAppNameHerePlease>.internal:13714"
Expand Down