Skip to content

Commit 03a28b2

Browse files
committed
Update README.md
1 parent d8cf437 commit 03a28b2

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

examples/templates/fly-docker-image/README.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,24 @@ This template provisions a [code-server](https://github.com/coder/code-server) i
77
- [flyctl](https://fly.io/docs/getting-started/installing-flyctl/) installed.
88
- [Coder](https://coder.com/) already setup and running with coder-cli installed locally.
99

10-
## Deploy
10+
## Getting started
1111

12-
1. Clone this repo and cd into `fly-docker-image` directory.
13-
2. Add a secret or environment variable to your Coder deployment with the name `FLY_API_TOKEN` and the value of your fly.io API token.
14-
> This is needed to deploy the workspace to fly.io.
12+
1. Run `coder templates init` and select this template. Follow the instructions that appear.
13+
2. cd into the directory that was created. (e.g. `cd fly-docker-image`)
14+
3. Create the new template by running the following command from the `fly-docker-image` directory:
1515

16-
```shell
17-
flyctl auth login
18-
export FLY_API_TOKEN=$(flyctl auth token)
16+
```bash
17+
coder templates create fly-docker-image --variable fly_api_token=$(flyctl auth token)
1918
```
2019

21-
Add this to your Coder deployment's environment variables. (e.g. `/etc/coder.d/coder.env`)
22-
23-
Or, If Coder is running as a fly.io app, you can set the secret directly:
24-
25-
```shell
26-
flyctl secrets set FLY_API_TOKEN=$(flyctl auth token) -a <coder-app-name>
27-
# where <coder-app-name> is the name of the Coder app on fly.io
28-
```
20+
> If your Coder is also running as a fly.io app, then instead of setting variable `fly_api_token` you can also set a fly.io secret with the name `FLY_API_TOKEN`
21+
>
22+
> ```bash
23+
> flyctl secrets set FLY_API_TOKEN=$(flyctl auth token) --app <your-coder-app-name>
24+
> ```
2925
3026
> Read our blog [post](coder.com/blog/deploying-coder-on-fly-io) to learn more about how to deploy Coder on fly.io.
3127
32-
3. Run `coder templates create fly-docker-image` to create a template in Coder.
33-
4. Create a new workspace from the template.
28+
4. Navigate to the Coder dashboard and create a new workspace using the template.
3429
3530
This is all. You should now have a code-server instance running on fly.io.
36-
37-
> Note: Change the image and the startup command to suit your needs.

0 commit comments

Comments
 (0)