diff --git a/Dockerfile b/Dockerfile index 5d56cb04..3d3154b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +FROM lwthiker/curl-impersonate:0.5-chrome-alpine AS builder + FROM python:3.9-alpine ENV PYTHONFAULTHANDLER=1 \ @@ -5,10 +7,16 @@ ENV PYTHONFAULTHANDLER=1 \ PYTHONDONTWRITEBYTECODE=1 \ PIP_DISABLE_PIP_VERSION_CHECK=on -RUN apk --no-cache add ffmpeg +COPY --from=builder /usr/local /usr/local + +RUN apk --no-cache add ffmpeg build-base nss ca-certificates WORKDIR /app COPY . . RUN pip install -r requirements.txt --no-cache-dir +RUN apk del build-base + +RUN ln -s /etc/ssl/certs/ca-certificates.crt /usr/local/lib/python3.9/site-packages/curl_cffi/cacert.pem + CMD ["python", "bot/main.py"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 6d9ff928..ca3e75fa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,9 +6,10 @@ python-telegram-bot==20.3 requests~=2.31.0 tenacity==8.2.2 wolframalpha~=5.0.0 -duckduckgo_search~=3.8.3 +duckduckgo_search~=4.1.0 spotipy~=2.23.0 pytube~=15.0.0 gtts~=2.3.2 whois~=0.9.27 Pillow~=10.1.0 +curl-cffi~=0.5.10