Skip to content

Commit

Permalink
dockerfile improvements for smaller image
Browse files Browse the repository at this point in the history
  • Loading branch information
Bombg committed Oct 27, 2024
1 parent 2d084e7 commit 501abc2
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
FROM python:3.11.3-slim AS build

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update -y && apt install -y git
# Build dummy packages to skip installing them and their dependencies -- Copied from FlareSolverr
RUN apt update -y && apt install -y git \
&& apt-get install -y --no-install-recommends equivs \
&& equivs-control libgl1-mesa-dri \
&& printf 'Section: misc\nPriority: optional\nStandards-Version: 3.9.2\nPackage: libgl1-mesa-dri\nVersion: 99.0.0\nDescription: Dummy package for libgl1-mesa-dri\n' >> libgl1-mesa-dri \
&& equivs-build libgl1-mesa-dri \
&& mv libgl1-mesa-dri_*.deb /libgl1-mesa-dri.deb \
&& equivs-control adwaita-icon-theme \
&& printf 'Section: misc\nPriority: optional\nStandards-Version: 3.9.2\nPackage: adwaita-icon-theme\nVersion: 99.0.0\nDescription: Dummy package for adwaita-icon-theme\n' >> adwaita-icon-theme \
&& equivs-build adwaita-icon-theme \
&& mv adwaita-icon-theme_*.deb /adwaita-icon-theme.deb

RUN python3 -m venv /venv
ENV PATH=/venv/bin:$PATH
Expand All @@ -19,7 +28,11 @@ ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /opt/SassBot

RUN apt update -y && apt install -y --no-install-recommends chromium xvfb
RUN apt update -y && apt install -y --no-install-recommends chromium xvfb \
# Remove temporary files and hardware decoding libraries -- Copied from FlareSolverr
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /usr/lib/x86_64-linux-gnu/libmfxhw* \
&& rm -f /usr/lib/x86_64-linux-gnu/mfx/*

COPY --from=build /venv /venv
ENV PATH=/venv/bin:$PATH
Expand Down

0 comments on commit 501abc2

Please sign in to comment.