Skip to content

Commit 26aef03

Browse files
committed
Hotfix: Revise Fly configuration
1 parent 1665eda commit 26aef03

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,12 @@ If you encountered an error while waiting for the services to be deployed on Ren
7171
The hosting service Fly.io does not have one-click hosting like Render and it does not have a free tier that HostedGPT can fit within, that's why Render is our default recommendation. But Fly is also great and we have created a configuration to make it easy for you to deploy there.
7272

7373
1. You must first install the Fly command-line tool [view instructions](https://fly.io/docs/hands-on/install-flyctl/)
74-
3. Next run `fly launch` and say `Yes` to copy the existing fly.toml but note that it will generate the wrong settings
74+
3. Next run `fly launch --build-only` and say `Yes` to copy the existing fly.toml but note that it will generate the wrong settings
7575
4. **The settings it shows are INCORRECT** so tell it you want to make changes
7676
5. When it opens your browser, change the Database to `Fly Postgres` and a name such as `hostedgpt-db` and you can set the configuration to `Development`
77-
6. Also in the browser, change the Redis to `Upstash for Redis`
7877
7. Click `Confirm Settings` and close the browser.
79-
8. The app will do a bunch of build steps and attempt to deploy the app but **it will fail with an error message about "Missing `secret_key_base`"**. When you get back to the command prompt, first scroll through the output and save the Postgres username & password somewhere as you'll never be able to see those again.
80-
9. Next run `bin/rails db:setup_encryption[true]`. This will initialize some private keys for your app and send them to Fly. (This can't be done until your app exists, which doesn't happen until you attempt your first deploy, that's why we intentionally hit that error.)
78+
8. The app will do a bunch of build steps and then return to the prompt. Scroll through the output and save the Postgres username & password somewhere as you'll never be able to see those again.
79+
9. Next run `bin/rails db:setup_encryption[true]`. This will initialize some private keys for your app and send them to Fly.
8180
10. Finally run `fly deploy`
8281

8382

config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@
9595
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
9696
# ]
9797
# Skip DNS rebinding protection for the default health check endpoint.
98-
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
98+
config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
9999
end

fly.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# fly.toml app configuration file generated for hostedgpt on 2024-05-02T12:36:21-05:00
1+
# fly.toml app configuration file generated for hostedgpt on 2024-05-05T14:39:50-05:00
22
#
33
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
44
#
@@ -13,18 +13,18 @@ console_command = '/rails/bin/rails console'
1313
[deploy]
1414
release_command = './bin/rails db:prepare'
1515

16-
[processes]
17-
app = './bin/rails server'
18-
1916
[env]
2017
RUN_SOLID_QUEUE_IN_PUMA = 'true'
2118

19+
[processes]
20+
app = './bin/rails server'
21+
2222
[http_service]
2323
internal_port = 3000
2424
force_https = true
25-
auto_stop_machines = true
25+
auto_stop_machines = false
2626
auto_start_machines = true
27-
min_machines_running = 0
27+
min_machines_running = 1
2828
processes = ['app']
2929

3030
[checks]
@@ -43,7 +43,7 @@ console_command = '/rails/bin/rails console'
4343
X-Forwarded-Proto = 'https'
4444

4545
[[vm]]
46-
memory = '1gb'
46+
memory = '512mb'
4747
cpu_kind = 'shared'
4848
cpus = 1
4949

0 commit comments

Comments
 (0)