Skip to content

Commit 5c0877a

Browse files
authored
Merge pull request #30 from coder/heroku-template
Add instructions to deploy a heroku workspace
2 parents 55cae19 + 4852d36 commit 5c0877a

File tree

1 file changed

+56
-7
lines changed

1 file changed

+56
-7
lines changed

heroku/README.md

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- A Heroku account
88
- Heroku CLI installed
99

10-
### Steps
10+
### Deploying Coder
1111

1212
1. Create a new Heroku app by using our deploy button below. This will automatically create a new app and deploy the latest version of Coder to it along with a basic postgres database.
1313

@@ -19,8 +19,6 @@
1919
heroku labs:enable runtime-dyno-metadata -a <app-name>
2020
```
2121

22-
Replace `<app-name>` with the name of your Heroku app.
23-
2422
> **Note:** `HEROKU_APP_NAME` is required by Coder to configure the `CODER_ACCESS_URL` environment variable. This is made available by enabling dyno metadata.
2523
2624
3. Clone the repository to your local machine and connect it to your Heroku app by running the following commands in the terminal:
@@ -30,7 +28,58 @@
3028
heroku git:remote -a <app-name>
3129
```
3230

33-
Replace `<app-name>` with the name of your Heroku app.
31+
4. Push the repository to Heroku by running the following command in the terminal:
32+
33+
```bash
34+
git push heroku main
35+
```
36+
37+
5. Once the deployment is complete, you can access your Coder instance by going to `https://<app-name>.herokuapp.com`.
38+
39+
## Creating your first workspace
40+
41+
We have an example community template that you can use to create your first workspace deployed as an ephemeral heroku worker dyno. Follow the steps below to create your first workspace:
42+
43+
1. Install Coder locally by running the following command in the terminal:
44+
45+
Linux / macOS:
46+
47+
```bash
48+
curl -fsSL https://coder.com/install.sh | sh
49+
```
50+
51+
Windows:
52+
53+
```powershell
54+
winget install Coder.Coder
55+
```
56+
57+
2. Login to your Coder instance by running the following command in the terminal:
58+
59+
```bash
60+
coder login https://<app-name>.herokuapp.com
61+
```
62+
63+
3. Clone the repository and change into the directory:
64+
65+
```bash
66+
git clone https://github.com/matifali/coder-templates
67+
cd coder-templates/heroku-worker-dyno
68+
```
69+
70+
4. Create the template:
71+
72+
```bash
73+
coder template create heroku-worker-dyno
74+
```
75+
76+
5. Create a workspace using the template from the Coder dashboard or by running the following command:
77+
78+
```bash
79+
coder create heroku-workspace --template heroku-worker-dyno --variable heroku_api_key=<heroku-api-key>
80+
```
81+
82+
> Replace `<heroku-api-key>` with your Heroku API key. You can create a new API key by going to your [account settings](https://dashboard.heroku.com/account).
3483
3584
## Updating Coder
3685

@@ -41,10 +90,10 @@ git pull origin main
4190
git push heroku main
4291
```
4392

44-
Replace `<app-name>` with the name of your Heroku app.
45-
4693
## Next steps
4794

48-
- Check out our [documentation](https://coder.com/docs) to learn how to configure your Coder instance.
95+
- Check out our [documentation](https://coder.com/docs/v2/latest/admin/configure) to learn how to configure your Coder instance.
4996

5097
- You can add environment variables to an Heroku app by going to the app's settings page and clicking on the "Reveal Config Vars" button.
98+
99+
> **Note:** Replace `<app-name>` with the name of your Heroku app.

0 commit comments

Comments
 (0)