Our great sponsors
-
Zalenium
Discontinued A flexible and scalable container based Selenium Grid with video recording, live preview, basic auth & dashboard.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
FROM python:3.9.2 LABEL org.opencontainers.image.source https://git.fraschetti.me/fraschm/vip-pre-market-scanner COPY requirements.txt / # instann python requirements RUN pip install -r requirements.txt # install geckodriver and firefox RUN GECKODRIVER_VERSION=\curl https://github.com/mozilla/geckodriver/releases/latest | grep -Po 'v[0-9]+.[0-9]+.[0-9]+'` && ` wget https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz && \ tar -zxf geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz -C /usr/local/bin && \ chmod +x /usr/local/bin/geckodriver && \ rm geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz RUN FIREFOX_SETUP=firefox-setup.tar.bz2 && \ wget -O $FIREFOX_SETUP "https://download.mozilla.org/?product=firefox-latest&os=linux64" && \ tar xjf $FIREFOX_SETUP -C /opt/ && \ ln -s /opt/firefox/firefox /usr/bin/firefox && \ rm $FIREFOX_SETUP COPY main.py / COPY utils /utils COPY configs /configs CMD [ "python", "./main.py" ]
I agree with ganic. It's better to run your browser(s) in separate containers. Look into zalenium https://opensource.zalando.com/zalenium/ you can get a seleniumgrid running with a few simple commands. Then just run your selenium app in another container pointing at the grid instead of looping back to localhost. You can optionally keep the grid running then and throw a bunch of selenium scripts at it in parallel. It can spin up extra browser containers and record everything.