|
FROM python:3.9 |
|
|
|
|
|
WORKDIR /code |
|
|
|
|
|
RUN pip install --upgrade pip |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
wget \ |
|
unzip \ |
|
xvfb \ |
|
libxi6 \ |
|
libgconf-2-4 \ |
|
libnss3 \ |
|
libxss1 \ |
|
libappindicator1 \ |
|
libindicator7 \ |
|
fonts-liberation \ |
|
libasound2 \ |
|
libatk-bridge2.0-0 \ |
|
libgtk-3-0 \ |
|
libx11-xcb1 \ |
|
libxcomposite1 \ |
|
libxcursor1 \ |
|
libxdamage1 \ |
|
libxi6 \ |
|
libxtst6 \ |
|
xdg-utils \ |
|
google-chrome-stable |
|
|
|
|
|
RUN CHROME_VERSION=$(google-chrome --version | grep -oP '\d+\.\d+\.\d+') \ |
|
&& wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/${CHROME_VERSION}/chromedriver_linux64.zip \ |
|
&& unzip /tmp/chromedriver.zip -d /usr/local/bin/ \ |
|
&& rm /tmp/chromedriver.zip |
|
|
|
|
|
COPY ./requirements.txt /code/requirements.txt |
|
|
|
|
|
RUN pip install --no-cache-dir -r /code/requirements.txt |
|
|
|
|
|
COPY . /code |
|
|
|
|
|
RUN mkdir -p /code/selenium_cache && chmod -R 755 /code/selenium_cache |
|
|
|
|
|
ENV XDG_CACHE_HOME /code/selenium_cache |
|
|
|
|
|
CMD ["python", "app.py"] |
|
|