-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
98 lines (78 loc) · 3.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
FROM python:3.12.0-alpine3.17
ENV PYTHONUNBUFFERED=1
RUN set -x; \
echo "**** install build packages ****" && \
apk add --no-cache --upgrade \
build-base \
ca-certificates \
curl \
git \
jq \
libffi-dev \
openssl-dev \
unzip && \
rm -rf /var/cache/apk/*
WORKDIR /wheels
COPY requirements.txt ./
RUN set -x; \
echo "**** build flexget wheels ****" && \
FLEXGET_VERSION=$(cat ./requirements.txt | grep FlexGet | awk 'BEGIN {FS="=="}; {print $2}') && \
TRANSMISSIONRPC_VERSION=$(cat ./requirements.txt | grep transmission | awk 'BEGIN {FS="=="}; {print $2}') && \
git clone --depth 1 --branch "v${FLEXGET_VERSION}" https://github.com/flexget/flexget /flexget && \
pip install -U pip && \
pip wheel -e /flexget && \
pip wheel transmission-rpc==${TRANSMISSIONRPC_VERSION}
WORKDIR /webui
RUN set -x; \
echo "**** download flexget web ui****" && \
wget https://github.com/Flexget/webui/releases/latest/download/dist.zip && \
unzip dist.zip && \
rm dist.zip
FROM python:3.12.0-alpine3.17
LABEL org.opencontainers.image.source="https://github.com/ksurl/docker-flexget"
LABEL maintainer="ksurl"
WORKDIR /config
ENV PYTHONUNBUFFERED=1 \
LOG_FILE=/config/flexget.log \
LOG_LEVEL=info \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=30000 \
TERM=xterm-256color \
TZ=UTC \
VERSION=docker
RUN set -x; \
echo "**** install packages ****" && \
apk add --no-cache --upgrade \
bash \
ca-certificates \
curl \
libstdc++ \
libressl-dev \
s6-overlay \
shadow \
tzdata && \
echo "**** create user ****" && \
groupmod -g 1000 users && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc && \
mkdir -p /config && \
echo "**** disable root login ****" && \
sed -i -e 's/^root::/root:!:/' /etc/shadow
COPY --from=0 /wheels /wheels
RUN set -x; \
echo "**** install flexget ****" && \
pip install -U pip && \
pip install --no-cache-dir --no-index \
-f /wheels \
FlexGet \
transmission-rpc && \
rm -rf /wheels
COPY --from=0 /webui /usr/local/lib/python3.11/site-packages/flexget/ui/v2/
RUN set -x; \
echo "**** cleanup ****" && \
rm -rf /tmp/* /var/cache/apk/* /root/.cache
COPY root/ /
HEALTHCHECK --interval=60s --timeout=15s --start-period=5s --retries=3 \
CMD [ "/bin/sh", "-c", "/bin/netstat -an | /bin/grep -q 5050" ]
EXPOSE 5050
VOLUME /config /data
ENTRYPOINT [ "/init" ]