Merge pull request #10 from mtoohey31/master

Added Dockerfile and notes on running via docker, or docker-compose
This commit is contained in:
Ganesh Kumar
2020-12-28 16:00:47 -05:00
committed by GitHub
3 changed files with 74 additions and 0 deletions

8
Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
FROM python:3-alpine
WORKDIR /build
COPY requirements.txt build_repo.py ./
RUN pip3 install -r requirements.txt
ENTRYPOINT python3 build_repo.py

View File

@@ -60,6 +60,55 @@ https://your-domain.com/extensions/index.json
```
* Import the above endpoint into the web/desktop client. (Note: Enable CORS for your web server respectively, nginx setup provided below)
### Docker
* To via Docker, clone the repository, set up the .env file, and optionally modify the `extensions` directory, following the instructions above.
* Next, build the container:
```bash
$ docker build -t standardnotes-extensions .
```
* Then run the container, specifying the mount points for the `.env` file, the `extensions` directory, and the `public` directory, where the output will be placed:
```bash
$ docker run \
-v $PWD/.env:/build/.env \
-v $PWD/extensions:/build/extensions \
-v $PWD/public:/build/public \
standardnotes-extensions
```
#### Docker Compose
If you would like to use the container with docker-compose, the exact setup will be somewhat specific to your configuration, however the following snippet may be helpful, assuming you have cloned this repository in your `$HOME` directory and followed the instructions regarding the .env file and `extensions` directory:
```yaml
version: '3.3'
services:
nginx:
...
volumes:
- standardnotes-extensions:/usr/share/nginx/html
standardnotes-extensions:
build:
context: $HOME/standardnotes-extensions/
restart: "no"
volumes:
- $HOME/standardnotes-extensions/.env:/build/.env
- $HOME/standardnotes-extensions/extensions:/build/extensions
- standardnotes-extensions:/build/public
volumes:
standardnotes-extensions:
name: standardnotes-extensions
```
This snippet will handle the building of the extension creation-container, and place the result in the `standardnotes-extensions` volume, which can then be mounted in the nginx container so that it can be served as demonstrated in the instructions below.
Please note that the confiuration snippet above is in no way a complete setup: you will still have to configure the nginx container and set up the syncing server containers.
### Setup with nginx
```nginx

View File

@@ -0,0 +1,17 @@
id: io.github.lzambarda.sn-nord-theme
github: lzambarda/sn-nord-theme
main: theme.css
name: Nord Theme
content_type: SN|Theme
area: themes
version: 0.0.2
marketing_url: https://github.com/lzambarda/sn-nord-theme
thumbnail_url: https://raw.githubusercontent.com/lzambarda/sn-nord-theme/master/preview.png
description: Standard Notes theme inspired by the magnificent Nord Theme.
dock_icon:
type: circle
background_color: '#5E81AC'
foreground_color: '#ECEFF4'
border_color: '#5e81ac'
...