Skip to content

Commit 269c349

Browse files
committed
Add image deployment example for Fly.io
1 parent 76dfb49 commit 269c349

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Targeted at hosters of version control platforms (such as [Wikifactory](https://
2323
- [Install](#install)
2424
- [Running from source](#running-from-source)
2525
- [Deploy as container](#deploy-as-container)
26+
- [Heroku example](#heroku-example)
27+
- [Fly.io example](#flyio-example)
2628
- [Usage](#usage)
2729
- [Making requests to the REST API](#making-requests-to-the-rest-api)
2830
- [API response format](#api-response-format)
@@ -131,6 +133,8 @@ podman run --env PORT=8000 --env GITHUB_TOKEN=[token] -p 127.0.0.1:8000:8000 -d
131133

132134
Where `token` is the 40 character alphanumeric string of your GitHub API personal access token. It is in the form of "ghp_2D5TYFikFsQ4U9KPfzHyvigMycePCPqkPgWc".
133135

136+
#### Heroku example
137+
134138
The image built this way can be pushed to cloud hosting providers such as [Heroku](https://www.heroku.com/). With Heroku as an example:
135139

136140
1. Set up an empty app from your Heroku dashboard.
@@ -163,6 +167,48 @@ https://wp22dev.herokuapp.com/data
163167

164168
This demo instance will go into a sleep state after a period of inactivity. If your API calls to this endpoint is taking more than a few seconds, it might be the demo waking from that state.
165169

170+
#### Fly.io example
171+
172+
Similar to Heroku, the container image created above can be deployed to an app on [Fly.io](https://fly.io/). Assuming an account has already been created:
173+
174+
1. Log in to Fly.io in a terminal session:
175+
176+
```
177+
flyctl auth login
178+
```
179+
180+
2. Launch a new app. Run the following command, which will ask for an app name. Enter `[your app name]`, replacing it with whatever name you'd like:
181+
182+
```
183+
flyctl launch
184+
```
185+
186+
3. Authorise pushing a container image to the Fly.io image registry:
187+
188+
```
189+
flyctl auth docker
190+
```
191+
192+
4. Push the locally built image to the remote Fly.io image registry:
193+
194+
```
195+
podman push wp22dev registry.fly.io/[your app name]
196+
```
197+
198+
5. Deploy the app:
199+
200+
```
201+
flyctl deploy --image registry.fly.io/[your app name]
202+
```
203+
204+
6. Set GitHub API personal access token as environmental variable:
205+
206+
```
207+
flyctl secrets set GITHUB_TOKEN=[token]
208+
```
209+
210+
Where `token` is the 40 character alphanumeric string of your GitHub API personal access token. It is in the form of "ghp_2D5TYFikFsQ4U9KPfzHyvigMycePCPqkPgWc".
211+
166212
## Usage
167213

168214
The backend server listens to requests for information about a list of open source hardware (and software) repositories hosted on Wikifactory or GitHub. The GitHub backend is a placeholder for now, but the Wikifactory backend is now accessible.

0 commit comments

Comments
 (0)