-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
32 lines (23 loc) · 1.01 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
FROM python:3.12-slim
COPY --from=ghcr.io/astral-sh/uv:0.6.3 /uv /uvx /bin/
RUN apt-get update && apt-get install -y wget
# additional repositories for fonts
RUN wget https://gist.githubusercontent.com/hakerdefo/5e1f51fa93ff37871b9ff738b05ba30f/raw/7b5a0ff76b7f963c52f2b33baa20d8c4033bce4d/sources.list -O /etc/apt/sources.list
# RUN sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list
RUN apt-get update \
&& apt-get install -y --no-install-recommends git sqlite3 ttf-mscorefonts-installer \
&& apt-get purge -y --auto-remove \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /bot
RUN mkdir /bot/db
ENV PYTHONUNBUFFERED=1
ENV UV_COMPILE_BYTECODE=1
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project --no-dev
ADD . /bot
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
ENV PATH="/bot/.venv/bin:$PATH"
CMD ["uv", "run", "HatBot.py"]