-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (32 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
40 lines (32 loc) · 1.04 KB
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
FROM alpine
RUN apk update
RUN apk add --no-cache python3 wget unzip && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
rm -r /root/.cache
#Variables by default
ENV MONITORRENT_DEBUG=false
ENV MONITORRENT_IP=0.0.0.0
ENV MONITORRENT_PORT=6687
ENV MONITORRENT_DB_PATH=/app/settings/monitorrent.db
#Adding user app
RUN addgroup -S app && adduser -S -g app app
RUN mkdir -p /app/settings
#Downloading archive with app
RUN wget https://github.com/$(wget https://github.com/werwolfby/monitorrent/releases/latest -O - --no-check-certificate | egrep '/.*/.*/monitorrent.*zip' -o) -O /tmp/monitorrent.zip --no-check-certificate
#Unzipping
RUN unzip -d /app/ /tmp/monitorrent.zip
#Changing work dir
WORKDIR /app
#Use port
EXPOSE 6687
#Installing depencies
RUN pip3 install -r requirements.txt
RUN rm requirements.txt
RUN apk del wget unzip
RUN rm -r /tmp/*
RUN chown -R app:app /app
USER app
CMD ["python3", "server.py"]