@@ -20,26 +20,28 @@ This project is led by an experienced rails developer, but I'm actively looking
2020
2121## Table of Contents
2222
23- - [ Top features of HostedGPT] ( #top-features-of-hostedgpt )
24- - [ Watch a short demo] ( #watch-a-short-demo )
25- - [ Table of Contents] ( #table-of-contents )
26- - [ Deploy the app on Render] ( #deploy-the-app-on-render )
27- - [ Troubleshooting Render] ( #troubleshooting-render )
28- - [ Deploy the app on Fly.io] ( #deploy-the-app-on-flyio )
29- - [ Deploy the app on Heroku] ( #deploy-the-app-on-heroku )
30- - [ Deploy on your own server] ( #deploy-on-your-own-server )
31- - [ Configure optional features] ( #configure-optional-features )
32- - [ Give assistant access to your Google apps] ( #configuring-google-tools )
33- - [ Authentication] ( #authentication )
34- - [ Password authentication] ( #password-authentication )
35- - [ Google OAuth authentication] ( #google-oauth-authentication )
36- - [ HTTP header authentication] ( #http-header-authentication )
37- - [ Contribute as a developer] ( #contribute-as-a-developer )
38- - [ Running locally] ( #Running-locally )
39- - [ Alternatively, you can skip Docker:] ( #alternatively-you-can-set-skip-docker )
40- - [ Running tests] ( #running-tests )
41- - [ Understanding the Docker configuration] ( #understanding-the-docker-configuration )
42- - [ Changelog] ( #changelog )
23+ - [ HostedGPT v0.6] ( #hostedgpt-v06 )
24+ - [ Top features of HostedGPT] ( #top-features-of-hostedgpt )
25+ - [ Watch a short demo] ( #watch-a-short-demo )
26+ - [ Table of Contents] ( #table-of-contents )
27+ - [ Deploy the app on Render] ( #deploy-the-app-on-render )
28+ - [ Troubleshooting Render] ( #troubleshooting-render )
29+ - [ Deploy the app on Fly.io] ( #deploy-the-app-on-flyio )
30+ - [ Deploy the app on Heroku] ( #deploy-the-app-on-heroku )
31+ - [ Deploy to own servers with Kamal2] ( #deploy-to-own-servers-with-kamal2 )
32+ - [ Deploy on your own server] ( #deploy-on-your-own-server )
33+ - [ Configure optional features] ( #configure-optional-features )
34+ - [ Configuring Google Tools] ( #configuring-google-tools )
35+ - [ Authentication] ( #authentication )
36+ - [ Password authentication] ( #password-authentication )
37+ - [ Google OAuth authentication] ( #google-oauth-authentication )
38+ - [ HTTP header authentication] ( #http-header-authentication )
39+ - [ Contribute as a developer] ( #contribute-as-a-developer )
40+ - [ Running locally] ( #running-locally )
41+ - [ Alternatively, you can skip Docker] ( #alternatively-you-can-skip-docker )
42+ - [ Running tests] ( #running-tests )
43+ - [ Understanding the Docker configuration] ( #understanding-the-docker-configuration )
44+ - [ Changelog] ( #changelog )
4345
4446## Deploy the app on Render
4547
@@ -111,6 +113,45 @@ Eligible students can apply for Heroku platform credits through [Heroku for GitH
111113
112114You may want to read about [ configuring optional features] ( #configure-optional-features ) .
113115
116+ ## Deploy to own servers with Kamal2
117+
118+ .. intro to Kamal
119+
120+ First, create your production credentials file.
121+
122+ ``` plain
123+ bin/rails credentials:edit --environment production
124+ ```
125+
126+ Next, uncomment the ` database: ` section
127+
128+ ``` yaml
129+ database :
130+ password : some-long-string
131+ ` ` `
132+
133+ Second, create a Docker Hub access token and store it as local env var ` KAMAL_REGISTRY_PASSWORD`.
134+
135+ Next, edit `config/deploy.yml` :
136+
137+ 1. Change `my-docker-user` to your Docker Hub username
138+ 2. Change `168.192.0.1` to the IP or hostname of your target Linux server
139+ 3. If you need to `ssh` into that server as anything other than `root` user, then uncomment `ssh:` section and edit your ssh username.
140+ 4. Change `hostedgpt.example.com` to the public CNAME or A record that points to your server IP address.
141+
142+ Next, commit all the changes to git so Kamal picks them up.
143+
144+ ` ` ` plain
145+ git add .
146+ git commit -m "Add production credentials and Kamal config"
147+ ` ` `
148+
149+ Now, run the command to setup the Postgres database, build HostedGPT using docker buildx, and deploy it to your server :
150+
151+ ` ` ` plain
152+ kamal setup
153+ ` ` `
154+
114155# # Deploy on your own server
115156
116157There are only two services that need to be running for this app to work : the Puma web server and a Postgres database.
0 commit comments