diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..3f47cb4 --- /dev/null +++ b/docker/Dockerfile @@ -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"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..753d459 --- /dev/null +++ b/docker/README.md @@ -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' +``` diff --git a/docker/requirements.txt b/docker/requirements.txt new file mode 100644 index 0000000..3ca8edf --- /dev/null +++ b/docker/requirements.txt @@ -0,0 +1,5 @@ +pyperclip +requests +configobj +colorama +cryptography