From 7912e1bd0b48dfdb70d2d2ef50f73b7175a6e65c Mon Sep 17 00:00:00 2001 From: Filipe Santos Date: Sat, 21 Apr 2018 04:00:03 +1200 Subject: [PATCH] Dockerfile --- .dockerignore | 23 +++++++++++++++++++++++ Dockerfile | 31 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e2c9e06 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,23 @@ +# Git +.git + +# Systemd files +systemd + +# Logs +*.log* + +# Configs +*.json + +# Byte-compiled / optimized / DLL files +**/__pycache__ +*.py[cod] +*$py.class +*.pyc + +# Pyenv +**/.python-version + +# User-specific stuff: +.idea diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3034b41 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM python:3.6-alpine3.7 + +ENV \ + # App directory + APP_DIR=traktarr \ + # Branch to clone + BRANCH=master \ + # Config file + TRAKTARR_CONFIG=/config/config.json \ + # Log file + TRAKTARR_LOGFILE=/config/traktarr.log + +RUN \ + echo "** Upgrade all packages **" && \ + apk --no-cache -U upgrade && \ + echo "** Install OS dependencies **" && \ + apk --no-cache -U add git && \ + echo "** Get Traktarr **" && \ + git clone --depth 1 --branch ${BRANCH} https://github.com/l3uddz/traktarr.git /${APP_DIR} && \ + echo "** Install PIP dependencies **" && \ + pip install --no-cache-dir --upgrade pip setuptools && \ + pip install --no-cache-dir --upgrade -r /${APP_DIR}/requirements.txt + +# Change directory +WORKDIR /${APP_DIR} + +# Config volume +VOLUME /config + +# Entrypoint +ENTRYPOINT ["python", "traktarr.py"]