You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[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)
39
+
-[Running locally](#running-locally)
40
+
-[Alternatively, you can skip Docker](#alternatively-you-can-skip-docker)
40
41
-[Running tests](#running-tests)
41
42
-[Understanding the Docker configuration](#understanding-the-docker-configuration)
42
43
-[Changelog](#changelog)
@@ -111,6 +112,45 @@ Eligible students can apply for Heroku platform credits through [Heroku for GitH
111
112
112
113
You may want to read about [configuring optional features](#configure-optional-features).
113
114
115
+
## Deploy to own servers with Kamal
116
+
117
+
[Kamal](https://kamal-deploy.org/) offers zero-downtime deploys, rolling restarts, asset bridging, remote builds, accessory service management, and everything else you need to deploy and manage your web app in production with Docker. Originally built for Rails apps, Kamal will work with any type of web app that can be containerized.
118
+
119
+
First, create your production credentials file.
120
+
121
+
```plain
122
+
bin/rails credentials:edit --environment production
123
+
```
124
+
125
+
Next, uncomment the `database:` section
126
+
127
+
```yaml
128
+
database:
129
+
password: some-long-string
130
+
```
131
+
132
+
Second, create a Docker Hub access token and store it as local env var `KAMAL_REGISTRY_PASSWORD`.
133
+
134
+
Next, edit `config/deploy.yml`:
135
+
136
+
1. Change `my-docker-user` to your Docker Hub username
137
+
2. Change `168.192.0.1` to the IP or hostname of your target Linux server
138
+
3. If you need to `ssh` into that server as anything other than `root` user, then uncomment `ssh:` section and edit your ssh username.
139
+
4. Change `hostedgpt.example.com` to the public CNAME or A record that points to your server IP address.
140
+
141
+
Next, commit all the changes to git so Kamal picks them up.
142
+
143
+
```plain
144
+
git add .
145
+
git commit -m "Add production credentials and Kamal config"
146
+
```
147
+
148
+
Now, run the command to setup the Postgres database, build HostedGPT using docker buildx, and deploy it to your server:
149
+
150
+
```plain
151
+
kamal setup
152
+
```
153
+
114
154
## Deploy on your own server
115
155
116
156
There 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