From 9f3f78c0707408177b62135c6b32e563c81c8959 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sun, 31 Oct 2021 16:55:13 +0100 Subject: [PATCH] Docker: make it possible to use it as cli --- Dockerfile | 2 +- README.md | 24 +++++++++++++++++++----- docker-entry.sh | 7 +++++++ 3 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 docker-entry.sh diff --git a/Dockerfile b/Dockerfile index 80ed8d1..3fd71d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,4 @@ RUN pip3 install --no-cache-dir /app[full] gunicorn USER 1000:1000 -CMD gunicorn --bind 0.0.0.0:8000 -w 4 --preload --access-logfile - morss +ENTRYPOINT /bin/sh /app/docker-entry.sh diff --git a/README.md b/README.md index d4db131..b06e924 100644 --- a/README.md +++ b/README.md @@ -69,11 +69,10 @@ it with the system package manager. ### Docker -Build & run +Build ```shell docker build --tag morss https://git.pictuga.com/pictuga/morss.git --no-cache --pull -docker run -p 8000:8000 morss ``` With docker-compose: @@ -91,7 +90,6 @@ Then execute ```shell docker-compose build --no-cache --pull -docker-compose up ``` ## Run @@ -117,9 +115,19 @@ Works like a charm with [Tiny Tiny RSS](https://tt-rss.org/), and most probably other clients. -#### Via Docker +#### Using Docker -See above (in Install) +Run + +```shell +docker run -p 8000:8000 morss +``` + +With docker-compose: + +```shell +docker-compose up +``` #### Using Gunicorn @@ -191,6 +199,12 @@ For example: `morss --clip http://feeds.bbci.co.uk/news/rss.xml` *(Brackets indicate optional text)* +If using Docker: + +```shell +docker run morss --clip http://feeds.bbci.co.uk/news/rss.xml +``` + ### As a newsreader hook To use it, the newsreader [Liferea](http://lzone.de/liferea/) is required diff --git a/docker-entry.sh b/docker-entry.sh new file mode 100644 index 0000000..aa7122a --- /dev/null +++ b/docker-entry.sh @@ -0,0 +1,7 @@ +#! /bin/sh + +if [ ! -z "$1" ]; then + morss $@ +else + gunicorn --bind 0.0.0.0:8000 -w 4 --preload --access-logfile - morss +fi