-
-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathDockerfile
75 lines (57 loc) · 1.84 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
FROM python:3.12-alpine AS build
ENV UV_INSTALL_DIR="/uv"
RUN apk update && \
apk add --no-cache \
bash \
curl \
g++ \
gcc \
libffi-dev \
make \
musl-dev && \
curl -LsSf https://astral.sh/uv/install.sh | sh
SHELL ["/bin/bash", "-c"]
ENV PATH="$UV_INSTALL_DIR:$PATH"
WORKDIR /tmp
COPY pyproject.toml /tmp/pyproject.toml
COPY uv.lock /tmp/uv.lock
COPY install_unrar.sh /tmp/install_unrar.sh
RUN uv sync --no-cache --locked && \
/tmp/install_unrar.sh
FROM python:3.12-alpine
ENV UV_INSTALL_DIR="/uv"
ARG VERSION="7.3.0"
LABEL org.opencontainers.image.authors="EDM115 <[email protected]>"
LABEL org.opencontainers.image.base.name="python:3.12-alpine"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.source="https://github.com/EDM115/unzip-bot.git"
LABEL org.opencontainers.image.title="unzip-bot"
LABEL org.opencontainers.image.url="https://github.com/EDM115/unzip-bot"
LABEL org.opencontainers.image.version=${VERSION}
RUN apk update && \
apk add --no-cache \
bash \
cgroup-tools \
cpulimit \
curl \
ffmpeg \
git \
tar \
tzdata \
util-linux \
zstd && \
apk add --no-cache 7zip --repository=https://dl-cdn.alpinelinux.org/alpine/edge/main && \
curl -LsSf https://astral.sh/uv/install.sh | sh && \
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
SHELL ["/bin/bash", "-c"]
ENV PATH="$UV_INSTALL_DIR:/venv/bin:$PATH"
ENV TZ=Europe/Paris
WORKDIR /app
COPY --from=build /tmp/.venv /venv
COPY --from=build /usr/local/bin/unrar /tmp/unrar
RUN git clone -b v7 https://github.com/EDM115/unzip-bot.git /app && \
install -m 755 /tmp/unrar /usr/local/bin && \
rm -rf /tmp/unrar && \
source /venv/bin/activate
COPY .env /app/.env
ENTRYPOINT ["/bin/bash", "/app/start.sh"]