Skip to content

Commit

Permalink
Render with Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
psonnera committed Jun 17, 2024
1 parent cf54529 commit 988cb38
Show file tree
Hide file tree
Showing 18 changed files with 264 additions and 138 deletions.
44 changes: 29 additions & 15 deletions docs/update/dev_branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Select your platform below:
- If you ran into trouble, try to [Redeploy](/update/redeploy.md) (and this is **mandatory** if you don't see `dev` in GitHub.)</br></br>
:::
:::{tab-item} Google Cloud, Docker (Azure, Northflank, Railway)
:::{tab-item} Google Cloud, Docker (Azure, Northflank, Railway, Render)
</br>You don't need to update your GitHub repository.</br></br>
:::
Expand All @@ -54,6 +54,10 @@ Select your platform below:
</br>
:::
:::{tab-item} Google Cloud
[Here](https://navid200.github.io/xDrip/docs/Nightscout/Customize.html)</br>
:::
:::{tab-item} Heroku
- Log in Heroku [https://id.heroku.com/login](https://id.heroku.com/login)</br></br>
<img src="/vendors/heroku/img/UpdateNS15.png" width="400px" ></br></br>
Expand Down Expand Up @@ -113,29 +117,29 @@ f) On the top left of the screen `Deploy`.</br></br>
- Your site will redeploy with the latest version.</br></br>
:::
:::{tab-item} Northflank (Docker)
:::{tab-item} Northflank (GitHub)
- Log into Northflank: [https://app.northflank.com/login](https://app.northflank.com/login)</br>
- Select your Nightscout project</br></br>
<img src="/vendors/northflank/img/Dev14.png" width="600px" /></br></br>
- Select your Nightscout service</br></br>
<img src="/vendors/northflank/img/Dev15.png" width="500px" /></br></br>
- In Overview, Edit deployment</br></br>
<img src="/vendors/northflank/img/Dev18.png" width="800px" /></br></br>
- In the image path, replace `nightscout/cgm-remote-monitor:latest` with the [version](https://hub.docker.com/r/nightscout/cgm-remote-monitor/tags) you want to deploy (for example `nightscout/cgm-remote-monitor:latest_dev`), then click `Update & rollout restart`</br></br>
<img src="/vendors/northflank/img/Dev19.png" width="600px" /></br></br>
- Click on the pen icon after the current branch (example below: `master`)</br></br>
<img src="/vendors/northflank/img/Dev16.png" width="600px" /></br></br>
- In the branch list, select the version you want to deploy, then click `Update Build Source`</br></br>
<img src="/vendors/northflank/img/Dev17.png" width="800px" /></br></br>
- Your site will redeploy with the selected branch</br>
:::
:::{tab-item} Northflank (GitHub)
:::{tab-item} Northflank (Docker)
- Log into Northflank: [https://app.northflank.com/login](https://app.northflank.com/login)</br>
- Select your Nightscout project</br></br>
<img src="/vendors/northflank/img/Dev14.png" width="600px" /></br></br>
- Select your Nightscout service</br></br>
<img src="/vendors/northflank/img/Dev15.png" width="500px" /></br></br>
- Click on the pen icon after the current branch (example below: `master`)</br></br>
<img src="/vendors/northflank/img/Dev16.png" width="600px" /></br></br>
- In the branch list, select the version you want to deploy, then click `Update Build Source`</br></br>
<img src="/vendors/northflank/img/Dev17.png" width="800px" /></br></br>
- In Overview, Edit deployment</br></br>
<img src="/vendors/northflank/img/Dev18.png" width="800px" /></br></br>
- In the image path, replace `nightscout/cgm-remote-monitor:latest` with the [version](https://hub.docker.com/r/nightscout/cgm-remote-monitor/tags) you want to deploy (for example `nightscout/cgm-remote-monitor:latest_dev`), then click `Update & rollout restart`</br></br>
<img src="/vendors/northflank/img/Dev19.png" width="600px" /></br></br>
- Your site will redeploy with the selected branch</br>
:::
Expand All @@ -155,10 +159,6 @@ Or whichever version (change `filter tag` find the version) in the [list](https:
<img src="/vendors/azure/img/Dev13.png" width="400px" /></br></br>
:::
:::{tab-item} Google Cloud
[Here](https://navid200.github.io/xDrip/docs/Nightscout/Customize.html)</br>
:::
:::{tab-item} Fly.io
Follow [these instructions](https://fly.io/docs/hands-on/install-flyctl/) to install `flyctl` on your computer. You also need to [install git](https://git-scm.com/downloads) if you're using a Windows computer.</br></br>
*Note for Windows: you might experience issues with Git Bash or PowerShell, try an elevated command prompt.*</br></br>
Expand Down Expand Up @@ -207,6 +207,20 @@ Visit your newly deployed app at https://example-ns.fly.dev/
</br>
:::
:::{tab-item} Render (Docker)
- Log into Render: [https://dashboard.render.com/](https://dashboard.render.com/)</br>
- Select your Nightscout project</br></br>
<img src="/vendors/render/img/Render16.png" width="400px" /></br></br>
- Go to `Settings` and scroll down to `Deploy`. Edit the URL of the image deployed</br></br>
<img src="/vendors/render/img/RenderD10.png" width="600px" /></br></br>
- Change it to:</br></br>
`nightscout/cgm-remote-monitor:latest_dev` (example for dev)</br>
Or whichever version (change `filter tag` find the version) in the [list](https://hub.docker.com/r/nightscout/cgm-remote-monitor/tags).</br>
`nightscout/cgm-remote-monitor:14.2.6` (example for 14.2.6)</br></br>
<img src="/vendors/render/img/RenderD11.png" width="600px" /></br></br>
- Click `Save changes`.</br></br>
- Your site will redeploy with the selected branch</br>
:::
````

Expand Down
2 changes: 1 addition & 1 deletion docs/update/downgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you use Heroku and you want to return to the previous version, see [Roll back

### **Docker**

You deployed a Docker container: you're not using GitHub (Azure, Northflank, Railway) use [this method](/update/dev_branch).
You deployed a Docker container: you're not using GitHub (Azure, Northflank, Railway, Render) use [this method](/update/dev_branch).

</br>

Expand Down
15 changes: 12 additions & 3 deletions docs/update/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Select your current platform below:
- If you ran into trouble, try to [Redeploy](/update/redeploy.md)</br></br>
:::
:::{tab-item} Google Cloud, Docker (Azure, Northflank, Railway)
:::{tab-item} Google Cloud, Docker (Azure, Northflank, Railway, Render)
</br>You don't need to update your GitHub repository.</br></br>
:::
Expand All @@ -58,6 +58,10 @@ Select your current platform below:
</br>
:::
:::{tab-item} Google Cloud
</br>Continue [here](https://navid200.github.io/xDrip/docs/Nightscout/update_nightscout.html)</br></br>
:::
:::{tab-item} Heroku
- Log in Heroku [https://id.heroku.com/login](https://id.heroku.com/login) </br>
</br><img src="/vendors/heroku/img/UpdateNS15.png" width="400px" ></br></br>
Expand Down Expand Up @@ -184,8 +188,13 @@ f) Go to the `Deployment` tab and from the three dots menu of the top deployment
- Your site will redeploy with the latest version.</br></br>
:::
:::{tab-item} Google Cloud
</br>Continue [here](https://navid200.github.io/xDrip/docs/Nightscout/update_nightscout.html)</br></br>
:::{tab-item} Render (Docker)
- Log into Render: [https://dashboard.render.com/](https://dashboard.render.com/)</br>
- Select your Nightscout project</br></br>
<img src="/vendors/render/img/Render16.png" width="400px" /></br></br>
- Go to `Settings` and top right expand `Manual Deploy`, Select `Deploy latest reference`</br></br>
<img src="/vendors/render/img/RenderD12.png" width="600px" /></br></br>
- Your site will redeploy with the updated Nightscout version</br>
:::
````
Expand Down
Binary file added docs/vendors/render/img/RenderD01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/vendors/render/img/RenderD12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
134 changes: 15 additions & 119 deletions docs/vendors/render/new_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ If you don't see `MONGODB_URI` but see `MONGO_CONNECTION` (**NOT** `MONGO_COLLEC

```{tab-set}
:::{tab-item} This is not necessary anymore (with a Docker image)
Continue with Step 2.
:::
:::{tab-item} I don't have a GitHub Account
### Create a GitHub account
::: {include} /vendors/github/create.md
Expand All @@ -68,47 +72,7 @@ If you don't see `MONGODB_URI` but see `MONGO_CONNECTION` (**NOT** `MONGO_COLLEC

</br>

## Step 2: Add the `render.yaml` template

- Sign in your GitHub account: [https://github.com/login](https://github.com/login).

<img src="/vendors/github/img/UpdateNS00.png" width="400px" ></br>

- Select your own `cgm-remote-monitor` project.

<img src="/vendors/github/img/UpdateNS01.png" width="400px" ></br>

1. Open the branches list
2. Type `render`
3. Select Create a branch: render from 'master'

<img src="/vendors/github/img/NewBranch.png" width="400px" ></br>

* Select Add File - Create new file

<img src="/vendors/github/img/AddFile.png" width="600px" ></br>

* Type `render.yaml` for the name. Leave it open like that for now.

<img src="/vendors/render/img/Yaml00.png" width="600px" ></br>

* Open the `render.txt` template from [here](/_static/render.txt) and edit it with a notepad app, **select all**, copy and paste into the GitHub page you have open from above.

<img src="/vendors/render/img/Yaml01.png" width="600px" ></br>

* Scroll up the page in GitHub and select `Commit changes` top right.

<img src="/vendors/render/img/Yaml02.png" width="800px" ></br>

* Confirm with `Commit changes`.

<img src="/vendors/render/img/Yaml03.png" width="400px" ></br>

* Your cgm-remote-monitor project is ready for Render Blueprints deploy.

</br>

## Step 3: Create a Render account
## Step 2: Create a Render account

a) Open a new browser page in [Render](https://render.com/) and select `GET STARTED FOR FREE`

Expand All @@ -132,93 +96,25 @@ e) Check your inbox and click the confirmation link

</br>

## Step 4: First deploy in Render

a) Select `Blueprints`

<img src="/vendors/render/img/Render06.png" width="400px" ></br>

b) Then `New blueprint instance`

<img src="/vendors/render/img/Render07.png" width="600px" ></br>

c) `Connect` your `cgm-remote-monitor` project

<img src="/vendors/render/img/Render08.png" width="600px" ></br>

d) Enter a name for your blueprint (anything simple, Nightscout is ok)

<img src="/vendors/render/img/Render09.png" width="400px" ></br>

e) Click the drop down menu of `Branch` (1) then select `render` (2)
## Step 3 - Deploy Nightscout in Render

<img src="/vendors/render/img/Render10.png" width="400px" ></br>
Select below how you want to do this:

**You now need to setup core variables for your site:**

<img src="/vendors/render/img/Render11.png" width="600px" ></br>

f) In `MONGODB_URI` paste your database connection string from Step 0 above

g) `API_SECRET` will be your Nightscout site password, it needs to be at least 12 characters long and you should **NOT use spaces** if you use @ or ! symbols remember you will probably need to express them using [Percent encoding](https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters) in your uploader and downloader apps. If you're not sure on how to do this, it is recommended to use only letters (uppercase + lowercase) and digits.

```{warning}
The API_SECRET is the **main password allowing full access to your Nightscout site**. Make sure it's reasonably secure (mix uppercase and lowercase letters, plus digits) and **do no not share it publicly**. If you think you exposed it by mistake, it is recommended that you **change it**.
```

h) Define your `DISPLAY_UNITS`
Acceptable choices for the units used in Nightscout are `mg/dl` or `mmol/L` (or just `mmol`).

</br>

i) Once all three variables have been set, `Apply`

<img src="/vendors/render/img/Render12.png" width="600px" ></br>

j) Your Nightscout site will be deployed. Wait until the operation completes after some minutes.

<img src="/vendors/render/img/Render13.png" width="300px" >

<img src="/vendors/render/img/Render14.png" width="300px" ></br>

Congratulations. You created your new Nightscout site with Render.

The following step is important, don't skip it.
```{tab-set}
</br>
:::{tab-item} Deploy with Docker (recommended)
:::{include} new_user_d.md
:::
## Step 5: Delete the `render` branch
:::{tab-item} Using a blueprint
:::{include} new_user_a.md
:::
```{hint}
In order to deploy your site with a blueprint, you needed to modify your GitHub repository.
Now you want to remove this modification so that you'll be able to update it normally.
```

- Sign in your GitHub account: [https://github.com/login](https://github.com/login).

<img src="/vendors/github/img/UpdateNS00.png" width="400px" ></br>

- Select your own `cgm-remote-monitor` project.

<img src="/vendors/github/img/UpdateNS01.png" width="400px" ></br>

* Click on branches to display all.

<img src="/vendors/render/img/Render18.png" width="400px" ></br>

* Locate the `render` branch and click on the bin icon to delete it.

<img src="/vendors/render/img/Render19.png" width="400px" ></br>

You have successfully removed the temporary modification required to deploy a new Render site.

<img src="/vendors/render/img/Render20.png" width="400px" ></br>

* Your Render site will redeploy using the normal `master` branch of `cgm-remote-monitor`, wait a few minutes until the operation completes.

</br>

* From the menu, `Dashboard`, then select your web service (the one you defined in step **4d**).
* From the menu, `Dashboard`, then select your web service.

<img src="/vendors/render/img/Render15.png" width="400px" >

Expand Down
Loading

0 comments on commit 988cb38

Please sign in to comment.