A quick proof-of-concept showing Playwright running in one container and Chrome running in another.
This repo is marked as archived as I don't intend to update it. It should work "as-is" but you use it at your own risk, etc, etc.
- Build the Python container with
docker-compose build
- Start the Chrome container running in the background with
docker-compose up chrome
- Optionally, watch the Chrome logs with
docker-compose logs -f chrome
- Optionally, watch the Chrome logs with
- Run the example Playwright script in it's container with
docker-compose run python
- See the resulting screenshot in
:/screenshots
as proof of a successful execution - Clean-up with
docker-compose down
Dependency management is provided via PDM. To get a local install working run pdm install --dev
.
Additionally, to configure VSCode to see the installed dependencies correctly, add the following to your :/.vscode/settings.json
:
{
"python.autoComplete.extraPaths": [
"__pypackages__/3.11/lib"
],
"python.analysis.extraPaths": [
"__pypackages__/3.11/lib"
]
}
The contents of this repo are all licensed under the MIT
license, please use it as you see fit.