-
Notifications
You must be signed in to change notification settings - Fork 1k
/
_launch_with_postgres.html.erb
67 lines (54 loc) · 2.26 KB
/
_launch_with_postgres.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<% app_name = app_name&.gsub("_", "\\_") %>
When we run `fly launch` from the newly-created project directory, the launcher will:
* Ask you to select a deployment region
* Set secrets required by <%= detected %> (`SECRET\_KEY\_BASE`, for example)
* Run the <%= detected %> deployment setup task
* Optionally setup a Postgres instance in your selected region
* Deploy the application in your selected region
```
cd <%= app_name %>
fly launch
```
```output
Creating app in /Users/me/<%= app_name %>
Scanning source code
Detected a <%= detected %> app
? App Name (leave blank to use an auto-generated name): <%= app_name %>
? Select organization: flyio (flyio)
? Select region: mad (Madrid, Spain)
Created app <%= app_name %> in organization soupedup
Set secrets on <%= app_name %>: SECRET\_KEY\_BASE
Installing dependencies
Running Docker release generator
Wrote config file fly.toml
? Would you like to setup a Postgres database now? Yes
Postgres cluster <%= app_name %>-db created
Username: postgres
Password: <password>
Hostname: <%= app_name %>-db.internal
Proxy Port: 5432
PG Port: 5433
Save your credentials in a secure place, you will not be able to see them again!
Monitoring Deployment
1 desired, 1 placed, 1 healthy, 0 unhealthy [health checks: 2 total, 2 passing]
--> v0 deployed successfully
Connect to postgres
Any app within the flyio organization can connect to postgres using the above credentials and the hostname "<%= app_name %>-db.internal."
For example: postgres\://postgres\:password@<%= app_name %>-db.internal\:5432
See the postgres docs for more information on next steps, managing postgres, connecting from outside fly: https://fly.io/docs/reference/postgres/
Postgres cluster <%= app_name %>-db is now attached to <%= app_name %>
Would you like to deploy now? Yes
Deploying <%= app_name %>
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8080
Remote builder fly-builder-little-glitter-8329 ready
...
```
That's it! Run `fly apps open` to see your deployed app in action.
Try a few other commands:
* `fly logs` - Tail your application logs
* `fly status` - App deployment details
* `fly status -a <%= app_name %>-db` - Database deployment details
* `fly deploy` - Deploy the application after making changes