Skip to content

Commit

Permalink
Update Dockerfile with latest Python and Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
ngosang committed Jan 4, 2023
1 parent 258225a commit f638169
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-slim-bullseye as builder
FROM python:3.11-slim-bullseye as builder

# Build dummy packages to skip installing them and their dependencies
RUN apt-get update \
Expand All @@ -12,28 +12,24 @@ RUN apt-get update \
&& equivs-build adwaita-icon-theme \
&& mv adwaita-icon-theme_*.deb /adwaita-icon-theme.deb

FROM python:3.10-slim-bullseye
FROM python:3.11-slim-bullseye

# Copy dummy packages
COPY --from=builder /*.deb /

# Install dependencies and create flaresolverr user
# We have to install and old version of Chromium because its not working in Raspberry Pi / ARM
# You can test Chromium running this command inside the container:
# xvfb-run -s "-screen 0 1600x1200x24" chromium --no-sandbox
# The error traces is like this: "*** stack smashing detected ***: terminated"
# To check the package versions available you can use this command:
# apt-cache madison chromium
WORKDIR /app
RUN echo "\ndeb http://snapshot.debian.org/archive/debian/20210519T212015Z/ bullseye main" >> /etc/apt/sources.list \
&& echo 'Acquire::Check-Valid-Until "false";' | tee /etc/apt/apt.conf.d/00snapshot \
# Install dummy packages
&& dpkg -i /libgl1-mesa-dri.deb \
RUN dpkg -i /libgl1-mesa-dri.deb \
&& dpkg -i /adwaita-icon-theme.deb \
# Install dependencies
&& apt-get update \
&& apt-get install -y --no-install-recommends chromium=89.0.4389.114-1 chromium-common=89.0.4389.114-1 \
chromium-driver=89.0.4389.114-1 xvfb \
&& apt-get install -y --no-install-recommends chromium chromium-common chromium-driver xvfb \
# Remove temporary files and hardware decoding libraries
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /usr/lib/x86_64-linux-gnu/libmfxhw* \
Expand All @@ -60,7 +56,7 @@ CMD ["/usr/local/bin/python", "-u", "/app/flaresolverr.py"]

# Local build
# docker build -t ngosang/flaresolverr:3.0.0 .
# docker run -p 8191:8191 ngosang/flaresolverr:3.0.0.beta2
# docker run -p 8191:8191 ngosang/flaresolverr:3.0.0

# Multi-arch build
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Expand Down

0 comments on commit f638169

Please sign in to comment.