-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from alexrashed/docker
Dockerfile
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3-alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN apk add --no-cache openssl-dev libxml2-dev libxslt-dev | ||
|
||
COPY . . | ||
|
||
RUN apk add --no-cache --virtual .build-deps gcc musl-dev libffi-dev \ | ||
&& pip install -e . \ | ||
&& apk del .build-deps | ||
|
||
ENTRYPOINT [ "feeds" ] |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.. _Docker: | ||
|
||
Docker | ||
========== | ||
|
||
If you prefer to run pyfeeds in a docker container, you can use the official `pyfeeds image <https://hub.docker.com/r/pyfeeds/pyfeeds/>`_. | ||
|
||
A ``docker-compose.yaml`` could look like this: | ||
|
||
.. code-block:: yaml | ||
version: "3.7" | ||
services: | ||
pyfeeds: | ||
image: pyfeeds/pyfeeds:latest | ||
volumes: | ||
- ./config:/config | ||
- pyfeeds-output:/output | ||
command: --config /config/feeds.cfg crawl | ||
volumes: | ||
pyfeeds-output: | ||
name: pyfeeds-output | ||
It mounts the ``config`` folder next to the ``docker-compose.yaml`` and uses the contained ``feeds.cfg`` as config for PyFeeds. The feeds are stored in a volume which could be picked up by a webserver: | ||
|
||
.. code-block:: yaml | ||
version: "3.7" | ||
services: | ||
pyfeeds-server: | ||
image: nginx:stable-alpine | ||
restart: always | ||
volumes: | ||
- pyfeeds-output:/usr/share/nginx/html:ro | ||
volumes: | ||
pyfeeds-output: | ||
external: true | ||
name: pyfeeds-output | ||
Now any other container in the same docker network (f.e. a ttrss server) could access the feeds (f.e. http://pyfeeds-server/theoatmeal.com/feed.atom). | ||
Add a port mapping in case you want to allow access from outside the container's docker network. |
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