forked from Gin-no-kami/docker-pixivutil2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
69 lines (57 loc) · 1.48 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
FROM alpine:latest
ARG DOCKER_IMAGE_VERSION=v20211104
# Define software versions
ARG VERSION=v20211104
# Define software download URLs
ARG SRC_URL=https://github.com/Nandaka/PixivUtil2/archive/refs/tags/${VERSION}.tar.gz
# Define working directory.
WORKDIR /tmp
# Install base dependencies.
RUN apk add \
curl \
python3 \
zlib-dev \
build-base \
jpeg-dev \
python3-dev \
bash \
nano \
ffmpeg \
&& \
ln -sf python3 /usr/bin/python
# Setup pip
RUN python3 -m venv python-env
RUN source python-env/bin/activate
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools
# Install PixivUtil2
RUN \
mkdir /opt/PixivUtil2 \
&& \
curl -# -L ${SRC_URL} | tar xz --strip 1 -C /opt/PixivUtil2 \
&& \
cd /opt/PixivUtil2 \
&& \
ls -al \
&& \
pip3 install -r requirements.txt \
&& \
apk del curl \
&& \
rm -rf /tmp/* /tmp/.[!.]*
ADD crontab.txt /crontab.txt
ADD pixivAuto.sh /pixivAuto.sh
COPY cronInit.sh /cronInit.sh
RUN chmod 755 /pixivAuto.sh /cronInit.sh
RUN /usr/bin/crontab /crontab.txt
# Define mountable directories.
VOLUME ["/config"]
VOLUME ["/storage"]
CMD ["/cronInit.sh"]
# Metadata.
LABEL \
org.label-schema.name="PixivUtil2" \
org.label-schema.description="Docker container for PixivUtil2" \
org.label-schema.version="$DOCKER_IMAGE_VERSION" \
org.label-schema.vcs-url="https://github.com/Gin-no-kami/docker-pixivutil2/" \
org.label-schema.schema-version="1.0"