sabnzbd/Dockerfile

82 lines
2.2 KiB
Docker
Raw Normal View History

2017-11-03 08:49:44 +01:00
FROM "debian:stretch"
2017-11-06 20:08:42 +01:00
MAINTAINER "Julien Cabillot <dockerimages@cabillot.eu>"
2017-10-31 21:38:46 +01:00
RUN groupadd -r -g 666 sabnzbd && \
useradd -l -r -u 666 -g 666 -d /sabnzbd sabnzbd
#
# Add SABnzbd init script.
#
2017-11-01 18:45:44 +01:00
COPY "sabnzbd.sh" "/sabnzbd.sh"
RUN chmod 755 "/sabnzbd.sh"
2017-10-31 21:38:46 +01:00
#
# Fix locales to handle UTF-8 characters.
#
ENV LANG C.UTF-8
#
# Install SABnzbd and all required dependencies.
#
RUN export SABNZBD_VERSION=2.3.0 PAR2CMDLINE_VERSION=v0.6.14-mt1 && \
export DEBIAN_FRONTEND=noninteractive && \
2017-11-01 18:45:44 +01:00
export BUILD_PACKAGES="automake build-essential python-dev python-pip" && \
export RUNTIME_PACKAGES="ca-certificates p7zip-full python-cheetah python-yenc unrar unzip libgomp1 openssl python-cryptography python-openssl curl" && \
2017-10-31 21:38:46 +01:00
export PIP_PACKAGES="sabyenc" && \
sed -i "s/ main$/ main contrib non-free/" /etc/apt/sources.list && \
apt-get -q update && \
apt-get install -qqy $BUILD_PACKAGES $RUNTIME_PACKAGES && \
pip install $PIP_PACKAGES && \
curl -SL -o /tmp/sabnzbd.tar.gz https://github.com/sabnzbd/sabnzbd/releases/download/${SABNZBD_VERSION}/SABnzbd-${SABNZBD_VERSION}-src.tar.gz && \
tar xzf /tmp/sabnzbd.tar.gz && \
mv SABnzbd-* sabnzbd && \
chown -R sabnzbd: sabnzbd && \
curl -o /tmp/par2cmdline-mt.tar.gz https://codeload.github.com/jkansanen/par2cmdline-mt/tar.gz/${PAR2CMDLINE_VERSION} && \
tar xzf /tmp/par2cmdline-mt.tar.gz -C /tmp && \
cd /tmp/par2cmdline-* && \
aclocal && \
automake --add-missing && \
autoconf && \
./configure && \
make && \
make install && \
apt-get -y remove --purge $BUILD_PACKAGES && \
apt-get -y autoremove --purge && \
apt-get -y clean all && \
2017-11-03 08:49:44 +01:00
rm -rf "/usr/share/doc/*" \
"/var/cache/*" \
"/var/lib/apt/lists/*" \
"/usr/src/*" \
"/var/cache/*" \
"/var/log/"{apt/*,dpkg.log} \
"/var/www/html" \
"/tmp/*"
2017-10-31 21:38:46 +01:00
#
# Define container settings.
#
VOLUME ["/datadir", "/media"]
EXPOSE 8080
#
# Start SABnzbd.
#
2017-11-01 18:45:44 +01:00
WORKDIR "/sabnzbd"
2017-10-31 21:38:46 +01:00
2017-11-06 11:44:18 +01:00
# Add Tini
ENV "TINI_VERSION" "v0.16.1"
ADD "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" "/tini"
RUN chmod +x "/tini"
ENTRYPOINT ["/tini", "--"]
2017-10-31 21:49:19 +01:00
2017-10-31 21:38:46 +01:00
CMD ["/sabnzbd.sh"]
2017-11-06 11:44:18 +01:00
HEALTHCHECK --interval="10s" \
CMD curl --fail "http://localhost:8080" || exit 1