FROM python:3.8 # Installing google chrome # Adding trusting keys to apt for repositories RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - # Adding Google Chrome to the repositories RUN sh -c 'echo "deb [arch=arm64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' # Updating apt to see and install Google Chrome RUN apt-get -y update # Magic happens RUN apt-get install -y google-chrome-stable # Installing chromium driver # Installing Unzip RUN apt-get install -yqq unzip # Download the Chrome Driver RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/` \ curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE \ `/chromedriver_linux64.zip # Unzip the Chrome Driver into /usr/local/bin directory RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ # Set display port as an environment variable ENV DISPLAY=:99 # Pip stuff RUN pip install --upgrade pip RUN python3 -m venv /venv # Python packages # pip install fastapi[all] # pip install requests # pip install selenium # pip install python-dotenv # pip install SQLAlchemy # pip install PyMySQL # pip install mysql-connector-python # pip install beautifulsoup4 # pip install Pillow # pip install aiofiles RUN . /venv/bin/activate && pip install --no-cache-dir \ aiofiles==22.1.0 anyio==3.6.2 async-generator==1.10 attrs==22.2.0 beautifulsoup4==4.11.1 \ certifi==2022.12.7 charset-normalizer==3.0.1 click==8.1.3 dnspython==2.2.1 email-validator==1.3.0 \ exceptiongroup==1.1.0 fastapi==0.89.1 greenlet==2.0.1 h11==0.14.0 httpcore==0.16.3 httptools==0.5.0 \ httpx==0.23.3 idna==3.4 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.1 mysql-connector-python==8.0.31 \ orjson==3.8.5 outcome==1.2.0 Pillow==9.4.0 protobuf==3.20.1 pydantic==1.10.4 PyMySQL==1.0.2 PySocks==1.7.1 \ python-dotenv==0.21.0 python-multipart==0.0.5 PyYAML==6.0 requests==2.28.2 rfc3986==1.5.0 selenium==4.7.2 \ six==1.16.0 sniffio==1.3.0 sortedcontainers==2.4.0 soupsieve==2.3.2.post1 SQLAlchemy==1.4.46 starlette==0.22.0 \ trio==0.22.0 trio-websocket==0.9.2 typing-extensions==4.4.0 ujson==5.7.0 urllib3==1.26.14 uvicorn==0.20.0 \ uvloop==0.17.0 watchfiles==0.18.1 websockets==10.4 wsproto==1.2.0 CMD . /venv/bin/activate && exec python