docker-pyload-ng/Dockerfile
2023-05-18 22:40:16 +02:00

66 lines
1.8 KiB
Docker

FROM alpine:edge as builder
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
apk add alpine-sdk doas uasm && \
echo 'permit nopass :wheel' > /etc/doas.d/doas.conf && \
git clone --depth=1 https://gitlab.alpinelinux.org/alpine/aports.git && \
git config --global user.name "build" && \
git config --global user.email "build@local" && \
abuild-keygen -a -i -n && \
cd aports/main/7zip && \
sed -i 's/DISABLE_RAR=1/USE_ASM=1/' APKBUILD && \
abuild -F && \
cd && \
cp packages/main/*/7zip-[0-9]*.apk 7zip.apk
FROM ghcr.io/linuxserver/baseimage-alpine:edge
# set version label
ARG DOCKER_IMAGE_CREATED
ARG VERSION
LABEL build_version="pyload docker version:- ${VERSION} Build-date:- ${DOCKER_IMAGE_CREATED}"
ENV HOME="/config"
COPY --from=builder /root/7zip.apk .
RUN \
apk add --no-cache --allow-untrusted 7zip.apk && \
rm -f 7zip.apk && \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
build-base \
curl-dev \
libffi-dev \
libjpeg-turbo-dev \
openssl-dev \
python3-dev \
zlib-dev && \
echo "**** install packages ****" && \
apk add --no-cache \
curl \
ffmpeg \
libjpeg-turbo \
python3 \
sqlite \
tesseract-ocr && \
echo "**** install pyload ****" && \
PYLOAD='https://github.com/pyload/pyload/archive/develop.zip#[all]' && \
if [[ -n "${VERSION}" && "${VERSION}" != "dev" ]]; then \
PYLOAD="pyload-ng[all]==${VERSION}"; \
fi && \
python3 -m ensurepip --upgrade && \
pip3 install -U wheel && \
pip3 install -U "${PYLOAD}" && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/*
# add local files
COPY root/ /
# ports and volumes
EXPOSE 8000
VOLUME /config