-
Notifications
You must be signed in to change notification settings - Fork 233
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (26 loc) · 969 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (26 loc) · 969 Bytes
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
# ---------- builder stage ----------
FROM python:3.11-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
libcairo2-dev libgirepository-2.0-dev \
build-essential cmake gcc meson \
&& rm -rf /var/lib/apt/lists/*
ENV PYTHONPATH=/usr/lib/python3/dist-packages
WORKDIR /build
COPY pyproject.toml .
RUN pip install --no-cache-dir --prefix=/install .
# ---------- runtime stage ----------
FROM python:3.11-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
libcairo2 gir1.2-pango-1.0 gobject-introspection \
fonts-noto-cjk \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /install /usr/local
COPY --from=builder /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
ENV PYTHONPATH=/usr/lib/python3/dist-packages
ENV PYTHONUNBUFFERED=1
RUN useradd -m botuser
WORKDIR /bot
COPY . .
RUN mkdir -p /bot/data && chown -R botuser:botuser /bot
USER botuser
CMD ["python", "-m", "tle"]