Browse Source

Add uploader.

master
Roelf Wichertjes 2 years ago
parent
commit
eff8eee5e2
Signed by: rewby GPG Key ID: 4C2B6D2972EE5423
3 changed files with 16 additions and 2 deletions
  1. +10
    -1
      Dockerfile
  2. +3
    -1
      entrypoint.sh
  3. +3
    -0
      uploader.sh

+ 10
- 1
Dockerfile View File

@@ -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" ]

+ 3
- 1
entrypoint.sh View File

@@ -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


+ 3
- 0
uploader.sh View File

@@ -0,0 +1,3 @@
#!/bin/bash
set -exuo pipefail
exec python3 -u /uploader.py "${UPLOAD_QUEUE}"

Loading…
Cancel
Save