Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker container #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM python:3-alpine

ENV NZBMONKEY_VERSION 0.2.5

WORKDIR /usr/src/
COPY requirements.txt /tmp/
ADD https://github.com/nzblnk/nzb-monkey/releases/download/v$NZBMONKEY_VERSION/nzbmonkey-v$NZBMONKEY_VERSION-linux.tbz2 nzbmonkey.tbz2
ADD https://github.com/nzblnk/nzb-monkey/pull/27/commits/5d255838ed0187bc5c023400d386aba77f296e73.patch fix_nzbking.patch

RUN mkdir -p /usr/src/nzbmonkey && tar --strip 1 -C ./nzbmonkey -xvjf nzbmonkey.tbz2 && rm nzbmonkey.tbz2 && \
patch -p1 nzbmonkey/nzbmonkey.py fix_nzbking.patch && \
apk add --no-cache --virtual .build-deps build-base libffi-dev openssl-dev && \
pip install --no-cache-dir --requirement /tmp/requirements.txt && \
addgroup -S nzbmonkey && adduser -S -g nzbmonkey nzbmonkey && \
apk del --no-cache .build-deps

USER nzbmonkey

ENTRYPOINT ["/usr/src/nzbmonkey/nzbmonkey.py"]
CMD ["--help"]
26 changes: 26 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Dockerfile for nzb-monkey

Run nzb-monkey inside a python alpine based docker container.

## Build & first run

First create a docker image and an empty config file. Then run a new container with the same user to match file permissions. The config file should be written. Now change the config according to your needs.

```bash
docker build -t nzbmonkey:latest .
touch nzbmonkey.cfg
docker run --rm -it -u $(id -u):$(id -g) -v $PWD/nzbmonkey.cfg:/usr/src/nzbmonkey/nzbmonkey.cfg nzbmonkey:latest 'nzblnk:?t=Our+Sommervacation&h=fbzzreinpngvba&g=a.b.documentaries&p=v4c4t10n4tw1n'
vi nzbmonkey.cfg
```

## Usage (nzblink)

```bash
docker run --rm -it -v $PWD/nzbmonkey.cfg:/usr/src/nzbmonkey/nzbmonkey.cfg nzbmonkey:latest 'nzblnk:?t=Our+Sommervacation&h=fbzzreinpngvba&g=a.b.documentaries&p=v4c4t10n4tw1n'
```

## Usage (parameters)

```bash
docker run --rm -it -v $PWD/nzbmonkey.cfg:/usr/src/nzbmonkey/nzbmonkey.cfg nzbmonkey:latest -t 'Our Sommervacation' -s 'fbzzreinpngvba' -p 'v4c4t10n4tw1n'
```
5 changes: 5 additions & 0 deletions docker/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pyperclip
requests
configobj
colorama
cryptography