Skip to content

Commit 0ecf0d8

Browse files
KTanAug21Kathryn Anne Tan
andauthored
Update the Laravel on Fly.io Quick start (superfly#2084)
Co-authored-by: Kathryn Anne Tan <kathrynannetan@Kathryns-MacBook-Air.local>
1 parent 8ffdcc7 commit 0ecf0d8

File tree

1 file changed

+41
-20
lines changed

1 file changed

+41
-20
lines changed

laravel/index.html.markerb

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,52 @@ You should be able to visit `http://localhost:8000` and see the home page.
3838

3939
### Launch
4040

41-
Next, we'll use the `launch` command to automagically configure your app for Fly.
42-
43-
The `launch` command adds a few files to your code base. Don't worry, it will ask before overwriting anything.
41+
Next, we'll use the `launch` command to automagically configure your app for Fly and deploy it to the Fly cloud. This will add a few files to your code base--but, don't worry, it will ask before overwriting anything.
4442

4543
**If you haven't already, go ahead and run `fly launch`!**
4644

4745
```cmd
4846
fly launch
4947
```
48+
This would detect that your project is built with Laravel. Afterwhich it would provide a summary of the default configuration that would be given to your app.
49+
50+
```
51+
We're about to launch your Laravel app on Fly.io. Here's what you're getting:
52+
53+
Organization: Personal (fly launch defaults to the personal org)
54+
Name: fly-lara-app (derived from your directory name)
55+
Region: Paris, France (this is the fastest region for you)
56+
App Machines: shared-cpu-1x, 1GB RAM (most apps need about 1GB of RAM)
57+
Postgres: <none> (not requested)
58+
Redis: Pay-as-you-go Plan: 10 GB Max Data Size, eviction disabled (determined from app source)
59+
Tigris: <none> (not requested)
60+
61+
? Do you want to tweak these settings before proceeding? (y/N)
62+
```
63+
64+
Extensions like [Postgres](/docs/mpg/overview/) ( database ), [Redis](/docs/upstash/redis/) ( cache ), and [Tigris](/docs/tigris/#main-content-start) ( storage ) can also be added by default based on whether there's an existing, similar connection found for your Laravel project.
5065

51-
When asked if you want to deploy now, say **No**.
66+
<div class="warning icon">
67+
**Please note** that these extension apps will also incur their own **usage costs**! You can select "y" in order to adjust the default settings and remove any extension you don't need.
68+
</div>
69+
70+
#### Launch Configuration
71+
Once you accept the configuration, this would proceed with **adding [default secrets](https://github.com/superfly/flyctl/blob/master/scanner/laravel.go#L41-L50)**, **deploying the accepted extensions**, and **generating files** on your project:
72+
1. `.github/workflows/fly-deploy.yml`, `fly.toml` - Configurations specific to hosting on Fly
73+
2. [.fly directory](https://github.com/fly-apps/dockerfile-laravel/tree/main/resources/views/fly) - A directory containing configuration files for running Nginx/PHP in a container
74+
3. [Dockerfile](https://github.com/fly-apps/dockerfile-laravel/blob/main/resources/views/dockerfile.blade.php) - Used to build a container image that is run in fly
75+
4. [.dockerignore](https://github.com/fly-apps/dockerfile-laravel/blob/main/resources/views/fly/dockerignore.blade.php) - Used to ensure certain files don’t make its way into your image
76+
77+
78+
With the configuration files and extenstion apps in place, an image is built for your app using your project and the Dockerfile generated for it. This image is then finally used to deploy your app.
79+
80+
#### Success!
81+
You should be able to visit `https://your-app-name.fly.dev` and see the Laravel demo home page.
82+
83+
<%= partial "docs/languages-and-frameworks/partials/launched" %>
84+
85+
86+
## Customizing your app
5287

5388
If you have other environment variables to set, you can edit the `fly.toml` file and add them.
5489

@@ -67,29 +102,15 @@ For sensitive data, you can set **secrets** with the [`fly secrets set`](https:/
67102
fly secrets set SOME_SECRET_KEY=<the-value-from-your-env-file>
68103
```
69104

70-
<div class="callout">
71-
The `fly launch` command will generate a secret with a valid, random value for `APP_KEY`.
72-
</div>
73105

74-
### Deploy
75106

76-
Finally, run `fly deploy` to build and deploy your application!
107+
### Deploy
77108

78-
You should be able to visit `https://your-app-name.fly.dev` and see the Laravel demo home page.
109+
Once you've made changes for your app locally, you can run `fly deploy` to deploy your changes.
79110

80-
<%= partial "docs/languages-and-frameworks/partials/launched" %>
81111

82112
### Some Notes
83113

84-
The `fly launch` adds some files to your code base.
85-
86-
**Here is what gets added:**
87-
88-
1. `Dockerfile` - Used to build a container image that is run in fly
89-
2. `.dockerignore` - Used to ensure certain files don't make its way into your repository
90-
3. `fly.toml` - Configuration specific to hosting on Fly
91-
4. `.fly` (formerly `docker`) - A directory containing configuration files for running Nginx/PHP in a container
92-
93114
Running `fly launch` (and later `fly deploy`) uses the `Dockerfile` to build a container image, copying your application files into the resulting image.
94115

95116
Fly doesn't care about the state of your git repository - it copies whatever files are present (except for files ignored by `.dockerignore`).

0 commit comments

Comments
 (0)