2024-09-18 20:28:44 +02:00
|
|
|
FROM python:3.12-alpine3.19
|
2024-07-20 10:42:31 +02:00
|
|
|
|
|
|
|
# Install dependencies
|
2024-07-12 00:49:34 +02:00
|
|
|
RUN apk add --no-cache \
|
2024-07-20 10:42:31 +02:00
|
|
|
xvfb \
|
2024-07-12 00:49:34 +02:00
|
|
|
nss \
|
|
|
|
freetype \
|
|
|
|
freetype-dev \
|
|
|
|
harfbuzz \
|
|
|
|
ca-certificates \
|
2024-07-20 10:42:31 +02:00
|
|
|
ttf-freefont \
|
|
|
|
chromium \
|
|
|
|
chromium-chromedriver
|
|
|
|
|
2024-07-12 00:49:34 +02:00
|
|
|
WORKDIR /usr/app/src
|
|
|
|
COPY index.py requirements.txt ./
|
|
|
|
|
2024-07-20 10:42:31 +02:00
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
COPY docker/scripts/startup.sh ./
|
2024-07-21 17:47:18 +02:00
|
|
|
|
|
|
|
RUN sed -i 's/await self.sleep(0.5)/await self.sleep(2)/' /usr/local/lib/python3.12/site-packages/nodriver/core/browser.py
|
|
|
|
|
2024-07-12 00:49:34 +02:00
|
|
|
# Run
|
2024-07-20 10:42:31 +02:00
|
|
|
CMD [ "./startup.sh"]
|