-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (38 loc) · 1.37 KB
/
Dockerfile
File metadata and controls
57 lines (38 loc) · 1.37 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
FROM python:3.14-alpine AS base
ENV \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
UV_INSTALL_DIR=/opt/uv
RUN apk add --no-cache \
build-base python3-dev libffi-dev openssl-dev git su-exec
RUN wget -qO- https://astral.sh/uv/install.sh | sh
ENV PATH="$UV_INSTALL_DIR:$PATH"
RUN rm -f /usr/local/bin/pip /usr/local/bin/pip3 && \
printf '#!/bin/sh\nexec uv pip "$@"\n' > /usr/local/bin/pip && \
chmod +x /usr/local/bin/pip
FROM base AS dependencies
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv sync --locked --extra full
FROM base AS runtime
ARG BUILDTIME
ARG VERSION
ARG REVISION
LABEL \
org.opencontainers.image.authors="Farzin Kazemzadeh <itisFarzin@proton.me>" \
org.opencontainers.image.source="https://github.com/6AMStuff/itisFarzinBot" \
org.opencontainers.image.title="itisFarzinBot" \
org.opencontainers.image.description="A base for Telegram (user)bots" \
org.opencontainers.image.created=$BUILDTIME \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.revision=$REVISION
WORKDIR /app
COPY --from=dependencies --chown=1000:1000 /app/.venv /app/.venv
ENV PATH="/app/.venv/bin:/opt/uv/bin:$PATH"
ENV VERSION=$VERSION
COPY --chown=1000:1000 . .
RUN chmod +x docker-entrypoint.sh
RUN mkdir -p config plugins
VOLUME ["/app/config", "/app/plugins"]
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["uv", "run", "python", "-m", "bot"]