diff --git a/Dockerfile b/Dockerfile index a041e7d..8fa08ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,13 +5,22 @@ ENV TINI_VERSION v0.19.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini RUN chmod +x /tini +RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y \ + build-essential dpkg-dev devscripts cmake git python3 python3-dev python3-pip \ + && rm -rf /var/lib/apt/lists/* + # Create data mount RUN mkdir -p /data RUN chown nobody:nogroup /data +WORKDIR / + COPY mover.sh /mover.sh COPY entrypoint.sh /entrypoint.sh +COPY uploader.sh /uploader.sh +ADD https://raw.githubusercontent.com/ArchiveTeam/ArchiveBot/master/pipeline/requirements.txt /requirements.txt +ADD https://raw.githubusercontent.com/ArchiveTeam/ArchiveBot/master/uploader/uploader.py /uploader.py -WORKDIR /tmp +RUN pip3 install -r /requirements.txt ENTRYPOINT [ "/tini", "--", "/entrypoint.sh" ] diff --git a/entrypoint.sh b/entrypoint.sh index c61965a..40dac49 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,6 +17,8 @@ case "$1" in "mover") setpriv --reuid=nobody --regid=nogroup --init-groups --inh-caps=-all /mover.sh ;; - + "uploader") + setpriv --reuid=nobody --regid=nogroup --init-groups --inh-caps=-all /uploader.sh + ;; esac diff --git a/uploader.sh b/uploader.sh new file mode 100755 index 0000000..8370d50 --- /dev/null +++ b/uploader.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -exuo pipefail +exec python3 -u /uploader.py "${UPLOAD_QUEUE}"