-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5a390e
commit 251584e
Showing
1 changed file
with
11 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,126 +1,27 @@ | ||
# Relay Runner | ||
|
||
## Deploy this site to Fly.io | ||
Become a relay runner, help decentralize nostr, and take control of your data. | ||
|
||
Make and account and setup billing on [Fly.io](https://fly.io) | ||
## For Contributors | ||
|
||
Install the flyctl CLI tool | ||
This site use [mkdocs material](https://squidfunk.github.io/mkdocs-material/). | ||
|
||
```bash | ||
brew install flyctl | ||
``` | ||
|
||
## Dockerfile | ||
|
||
Create a `Dockerfile` | ||
|
||
```bash | ||
touch Dockerfile | ||
``` | ||
|
||
Add the following to the `Dockerfile` | ||
|
||
```Dockerfile | ||
FROM squidfunk/mkdocs-material:latest as BUILDER | ||
WORKDIR /app | ||
COPY mkdocs.yml /app/mkdocs.yml | ||
COPY docs /app/docs | ||
RUN ["mkdocs", "build"] | ||
|
||
FROM nginx:stable-alpine3.17-slim | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
COPY --from=BUILDER /app/site /var/www/documentation | ||
HEALTHCHECK CMD curl --fail http://localhost:80 || exit 1" | ||
EXPOSE 80 | ||
``` | ||
## Nginx Configuration | ||
Create an `nginx.conf` file | ||
To get started, fork and clone the repository then run the following commands: | ||
|
||
```bash | ||
touch nginx.conf | ||
``` | ||
Add the following to the `nginx.conf` file | ||
```nginx | ||
server { | ||
python3 -m venv env | ||
|
||
listen 80; | ||
listen [::]:80; | ||
source env/bin/activate | ||
|
||
root /var/www/documentation; | ||
index index.html; | ||
error_page 404 403 /404.html; | ||
error_page 404 /404.html; | ||
location = /404.html { | ||
root /var/www/documentation; | ||
internal; | ||
} | ||
location /healthz { # Setups the `/healthz` page | ||
stub_status on; # Turns on the module designed to output status of the server | ||
access_log off; # Do not log requests to this endpoint | ||
allow 127.0.0.1; # Allows Localhost | ||
allow 172.16.0.0/12; # Allow Consul to access the page | ||
deny all; # Any one else gets put in the bin | ||
} | ||
} | ||
``` | ||
## Launch fly | ||
```bash | ||
flyctl launch | ||
pip install -r requirements.txt | ||
``` | ||
|
||
## GitHub Actions | ||
First head over to [fly.io](https://fly.io) and create a new token. | ||
In GitHub, navigate to your repo, then Settings > Secrets and Variables > Actions | ||
Here, create a Repository Secret called FLY_ACCESS_TOKEN - Paste in the value from the Fly.io dashboard | ||
Next create the workflows directory and add a `build-site.yml` file | ||
```bash | ||
mkdir -p .github/workflows | ||
``` | ||
To run the site locally, run the following command: | ||
|
||
```bash | ||
touch .github/workflows/build-site.yml | ||
``` | ||
Add the following to the `build-site.yml` file | ||
```yaml | ||
name: Build Site | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- docs/** | ||
- .github/workflows/build-site.yaml | ||
- mkdocs.yml | ||
- Dockerfile | ||
- fly.toml | ||
jobs: | ||
site: | ||
runs-on: ubuntu-latest | ||
name: Build Documentation | ||
steps: | ||
- name: Git Clone | ||
uses: actions/checkout@v4 | ||
- name: Fly Build and Deploy | ||
uses: userbradley/actions-fly@v1.0.0 | ||
with: | ||
flyToken: ${{ secrets.FLY_ACCESS_TOKEN }} | ||
mkdocs serve | ||
``` | ||
|
||
## DNS | ||
The documentation is written in markdown and can be found in the `docs` directory. | ||
|
||
https://fly.io/docs/networking/custom-domains-with-fly/ | ||
You will also need to edit the `mkdocs.yml` file to add new pages to the site. |