Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tonyp7/docker-flask-selenium-chromedriver
Dockerfile for running a Python / Flask web app with Selenium and chromedriver.
https://github.com/tonyp7/docker-flask-selenium-chromedriver
chromedriver docker docker-compose docker-image flask python selenium
Last synced: 3 days ago
JSON representation
Dockerfile for running a Python / Flask web app with Selenium and chromedriver.
- Host: GitHub
- URL: https://github.com/tonyp7/docker-flask-selenium-chromedriver
- Owner: tonyp7
- License: mit
- Created: 2023-12-02T04:13:41.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2023-12-25T05:47:10.000Z (11 months ago)
- Last Synced: 2024-10-11T13:36:45.724Z (27 days ago)
- Topics: chromedriver, docker, docker-compose, docker-image, flask, python, selenium
- Language: Dockerfile
- Homepage:
- Size: 85.9 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Containerized Selenium/Chromedriver running on Python and Flask
This is a docker image that comes pre-installed with a Python `Flask` web application that can run `Selenium` with `Chromedriver`.# Why?
I needed to do some automated tests with Selenium. In my experience Selenium and Chromedriver are finicky to setup and
as such benefit greatly from being containerized.
In addition, I wanted to be able to trigger these tests through http calls, which makes the whole system very easy to use.
And thus, docker-flask-selenium-chromedriver was born.# How to use it?
The image comes with a docker-compose yml and as such you can simply start the image with the following command:
```console
cd 3.12-slim
docker compose up
```By default, the web server will run on port 8000 and there's a /test endpoint that connects to [httpbin](https://httpbin.org/html) and returns OK if it was able to read the H1 tag.
e.g. you can confirm by running:
```console
curl 127.0.0.1:8000/test
OK
```# Image build
The image is based on `python-slim` image, which itself is based on `debian:bookworm-slim`. It adds:
Installed from apt:
- chromium
- chromium-driver
Installed from pip through requirements.txt
- flask
- gunicorn
- selenium