Sign inSign up

johnnyfan0875/web-scraping

By johnnyfan0875

•Updated about 1 year ago

Image
0

241

johnnyfan0875/web-scraping repository overview

⁠Use a lightweight official Python slim image

FROM python:3.10-slim

⁠Set environment variables

ENV PYTHONUNBUFFERED=1
DEBIAN_FRONTEND=noninteractive

⁠Install system dependencies required for Chrome, download tools, and fonts

RUN apt-get update && apt-get install -y --no-install-recommends
wget
curl
unzip
chromium-driver
chromium
fonts-liberation
libnss3
libxss1
libappindicator3-1
libatk-bridge2.0-0
libgtk-3-0
libxcomposite1
libxdamage1
libasound2
libdbus-glib-1-2
&& rm -rf /var/lib/apt/lists/*

⁠Set display port to avoid chromium errors

ENV DISPLAY=:99

⁠Upgrade pip and install specific python package versions

RUN pip install --no-cache-dir --upgrade pip
&& pip install --no-cache-dir
undetected-chromedriver==3.5.5
requests==2.31.0
beautifulsoup4==4.12.2
selenium==4.13.0
lxml==6.0.1

⁠Create working directory in container

WORKDIR /app

Tag summary

Content type

Image

Digest

sha256:59707cb27…

Size

349.6 MB

Last updated

about 1 year ago

docker pull johnnyfan0875/web-scraping:0.1.1