https://github.com/bengabp/sandbox
Run and manage playwright in a sandbox
https://github.com/bengabp/sandbox
browser-automation docker isolated playwright python sandboxing
Last synced: about 2 months ago
JSON representation
Run and manage playwright in a sandbox
- Host: GitHub
- URL: https://github.com/bengabp/sandbox
- Owner: bengabp
- Created: 2025-03-25T19:26:37.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-03-26T23:10:08.000Z (about 2 months ago)
- Last Synced: 2025-03-26T23:28:38.641Z (about 2 months ago)
- Topics: browser-automation, docker, isolated, playwright, python, sandboxing
- Language: Python
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sandbox
Initialize & Manage multiple playwright sandboxes.
## Running playwright in a sandbox
```bash
# Start xvfb virtual display server, you have to wait a bit for the server to startup
Xvfb :99 -screen 0 1920x1080x24 &# Set the DISPLAY environment variable
export DISPLAY=:99# Start the VNC server with x11vnc
x11vnc -display :99 -forever -shared -nopw -rfbport 5900 &# Start websockify to convert VNC to WebSocket (for noVNC)
websockify --web /usr/share/novnc 6080 localhost:5900 &# Finally, start your playwright automator, remember to set playwright to not run in headless mode
# Node js playwright
node /app/server.js# Python script
python3 /app/server.py
```## Running alembic migration
```bash
# Init alembic
alembic init alembic# generate migration scripts
alembic revision --autogenerate -m "optional custom name"# Apply migration
poetry run alembic upgrade head
```## Running the api
```bash
# Install dependencies
poetry update# Run api
uvicorn sandbox.main:app --host 0.0.0.0
```