-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (51 loc) · 2.1 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (51 loc) · 2.1 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1
RUN set -eux; \
if [ -f /etc/apt/sources.list.d/debian.sources ]; then \
sed -i 's/Components: main/Components: main contrib non-free non-free-firmware/g' \
/etc/apt/sources.list.d/debian.sources; \
else \
sed -i 's/ main$/ main contrib non-free non-free-firmware/' /etc/apt/sources.list || true; \
fi
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
p7zip-full \
p7zip-rar \
unrar \
ca-certificates \
gosu \
&& rm -rf /var/lib/apt/lists/*
RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
amd64) asset="kepubify-linux-64bit" ;; \
arm64) asset="kepubify-linux-arm64" ;; \
armhf) asset="kepubify-linux-arm" ;; \
i386) asset="kepubify-linux-32bit" ;; \
*) echo "Unsupported arch: $arch" >&2; exit 1 ;; \
esac; \
curl -fsSL "https://github.com/pgaskin/kepubify/releases/download/v4.0.4/${asset}" \
-o /usr/local/bin/kepubify; \
chmod +x /usr/local/bin/kepubify; \
kepubify --version
RUN ln -sf /usr/bin/7z /usr/local/bin/7za \
&& ln -sf /usr/bin/7z /usr/local/bin/7zr || true
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt \
&& pip install --no-cache-dir --no-deps git+https://github.com/ciromattia/kcc.git@v10.4.0
RUN mkdir -p /app /app/config /Comics_in /Comics_out /Books_in /Books_out /Comics_raw
WORKDIR /app
COPY app.py /app/app.py
COPY config.py /app/config.py
COPY processor.py /app/processor.py
COPY raw_processor.py /app/raw_processor.py
COPY templates/ /app/templates/
COPY static/ /app/static/
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
EXPOSE 5000
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD curl -f http://localhost:5000/health || exit 1
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["gunicorn", "--workers", "1", "--bind", "0.0.0.0:5000", "--timeout", "300", "--worker-tmp-dir", "/dev/shm", "--no-control-socket", "app:app"]