1
1
# Build Stage
2
- FROM python:3.11.3 -slim AS build
2
+ FROM python:3.11-slim-bullseye AS build
3
3
4
4
ENV DEBIAN_FRONTEND=noninteractive
5
-
6
- RUN apt update -y && apt install -y git
5
+ # Build dummy packages to skip installing them and their dependencies -- Copied from FlareSolverr
6
+ RUN apt update -y && apt install -y git \
7
+ && apt-get install -y --no-install-recommends equivs \
8
+ && equivs-control libgl1-mesa-dri \
9
+ && printf 'Section: misc\n Priority: optional\n Standards-Version: 3.9.2\n Package: libgl1-mesa-dri\n Version: 99.0.0\n Description: Dummy package for libgl1-mesa-dri\n ' >> libgl1-mesa-dri \
10
+ && equivs-build libgl1-mesa-dri \
11
+ && mv libgl1-mesa-dri_*.deb /libgl1-mesa-dri.deb \
12
+ && equivs-control adwaita-icon-theme \
13
+ && printf 'Section: misc\n Priority: optional\n Standards-Version: 3.9.2\n Package: adwaita-icon-theme\n Version: 99.0.0\n Description: Dummy package for adwaita-icon-theme\n ' >> adwaita-icon-theme \
14
+ && equivs-build adwaita-icon-theme \
15
+ && mv adwaita-icon-theme_*.deb /adwaita-icon-theme.deb
7
16
8
17
RUN python3 -m venv /venv
9
18
ENV PATH=/venv/bin:$PATH
@@ -13,16 +22,20 @@ RUN pip install -r requirements.txt && \
13
22
pip install uvloop
14
23
15
24
# Buidling final image, moving over venv
16
- FROM python:3.11.3-slim
17
-
18
- ENV DEBIAN_FRONTEND=noninteractive
25
+ FROM python:3.11-slim-bullseye
19
26
20
27
WORKDIR /opt/SassBot
21
28
22
- RUN apt update -y && apt install -y --no-install-recommends chromium xvfb
23
-
24
- COPY --from=build /venv /venv
29
+ ENV DEBIAN_FRONTEND=noninteractive
25
30
ENV PATH=/venv/bin:$PATH
31
+ COPY --from=build /*.deb /
32
+ COPY --from=build /venv /venv
33
+
34
+ RUN apt update -y && apt install -y --no-install-recommends chromium xvfb \
35
+ # Remove temporary files and hardware decoding libraries -- Copied from FlareSolverr
36
+ && rm -rf /var/lib/apt/lists/* \
37
+ && rm -f /usr/lib/x86_64-linux-gnu/libmfxhw* \
38
+ && rm -f /usr/lib/x86_64-linux-gnu/mfx/*
26
39
27
40
COPY . .
28
41
0 commit comments