Skip to content

Commit

Permalink
Change base image and all Plexpy references to Tautulli
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMeanCanEHdian committed Jul 4, 2018
1 parent 4965181 commit 3f7b8a1
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 27 deletions.
81 changes: 62 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,75 @@
FROM lsiobase/alpine.python:3.7
# Forked from https://github.com/linuxserver/docker-plexpy
FROM alpine:3.7

# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Tautulli version:- ${VERSION} Build-date:- ${BUILD_DATE}"
# set version for s6 overlay
ARG OVERLAY_VERSION="v1.21.4.0"
ARG OVERLAY_ARCH="amd64"

# environment variables
ENV PS1="$(whoami)@$(hostname):$(pwd)$ " \
HOME="/root" \
TERM="xterm"

# install packages
RUN \
apk add --no-cache --virtual=build-dependencies \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
autoconf \
automake \
curl \
g++ \
gcc \
linux-headers \
make \
python-dev && \

# install pycryptodomex Plexapi
pip install --no-cache-dir -U \
pycryptodomex plexapi && \

# cleanup
python2-dev \
tar && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
bash \
coreutils \
curl \
git \
py2-lxml \
py2-pip \
python2 \
shadow \
tar \
tzdata \
vnstat \
wget && \
echo "**** install pip packages ****" && \
pip install --no-cache-dir -U \
pip && \
pip install --no-cache-dir -U \
plexapi \
pycryptodomex && \
echo "**** add s6 overlay ****" && \
curl -o \
/tmp/s6-overlay.tar.gz -L \
"https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.gz" && \
tar xfz \
/tmp/s6-overlay.tar.gz -C / && \
echo "**** create abc user and make folders ****" && \
groupmod -g 1000 users && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc && \
mkdir -p \
/app \
/config \
/defaults && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
build-dependencies && \
rm -rf \
/root/.cache
/root/.cache \
/tmp/*

# add local files
COPY root/ /

ENTRYPOINT ["/init"]

# add local files
# add local files
COPY root/ /

# ports and volumes
# ports and volumes
VOLUME /config /logs
EXPOSE 8181
26 changes: 26 additions & 0 deletions root/etc/cont-init.d/10-adduser
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/with-contenv bash

PUID=${PUID:-911}
PGID=${PGID:-911}

groupmod -o -g "$PGID" abc
usermod -o -u "$PUID" abc

echo '
------------------------------------
_______ _ _ _ _
|__ __| | | | | (_)
| | __ _ _ _| |_ _ _| | |_
| |/ _` | | | | __| | | | | | |
| | (_| | |_| | |_| |_| | | | |
|_|\__,_|\__,_|\__|\__,_|_|_|_|

------------------------------------'
echo "GID/UID
User uid: $(id -u abc)
User gid: $(id -g abc)
------------------------------------
"
chown abc:abc /app
chown abc:abc /config
chown abc:abc /defaults
16 changes: 9 additions & 7 deletions root/etc/cont-init.d/30-install
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/usr/bin/with-contenv bash

#If variable $ADVANCED_GIT_BRANCH, set branch to $ADVANCED_GIT_BRANCH, otherwise, default to master
# If variable $ADVANCED_GIT_BRANCH, set branch to $ADVANCED_GIT_BRANCH, otherwise, default to master
[ "$ADVANCED_GIT_BRANCH" ] || \
ADVANCED_GIT_BRANCH="master"

[ "$ADVANCED_GIT_REPO" ] || \
ADVANCED_GIT_REPO="https://github.com/tautulli/tautulli.git"
ADVANCED_GIT_REPO="https://github.com/Tautulli/Tautulli.git"

# install app 
[[ ! -d "/opt/plexpy/.git" ]] && \
git clone --branch $ADVANCED_GIT_BRANCH $ADVANCED_GIT_REPO /opt/plexpy
INSTALL_FOLDER="/app/tautulli"

# permissions
# Install app 
[[ ! -d "${INSTALL_FOLDER}/.git" ]] && \
git clone --branch "$ADVANCED_GIT_BRANCH" "$ADVANCED_GIT_REPO" "${INSTALL_FOLDER}"

# Permissions
chown -R abc:abc \
/config \
/opt/plexpy
"${INSTALL_FOLDER}"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash

exec \
s6-setuidgid abc python /opt/plexpy/PlexPy.py \
s6-setuidgid abc python /app/tautulli/Tautulli.py \
--datadir /config

0 comments on commit 3f7b8a1

Please sign in to comment.