mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
- Add `Dockerfile` based on `mcr.microsoft.com/playwright:v1.57.0-jammy`. - Add `scripts/run-playwright-docker.sh` to build and run the container with volume mounts. - Add `.dockerignore` to prevent host `node_modules` from corrupting the build. - Update `README.md` with usage instructions.
30 lines
835 B
Bash
Executable File
30 lines
835 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Build the Docker image
|
|
echo "Building Docker image bitvid-playwright..."
|
|
docker build -t bitvid-playwright .
|
|
|
|
# Check if arguments are provided, default to "npm run test:visual" if not
|
|
if [ $# -eq 0 ]; then
|
|
CMD="npm run test:visual"
|
|
else
|
|
CMD="$@"
|
|
fi
|
|
|
|
echo "Running: $CMD"
|
|
|
|
# Run the container
|
|
# - --rm: Remove container after exit
|
|
# - -it: Interactive terminal
|
|
# - --ipc=host: Recommended for Playwright to avoid memory issues
|
|
# - -v $(pwd):/app: Mount current directory to /app for live code updates and artifacts
|
|
# - -v /app/node_modules: Anonymous volume to preserve container's node_modules (prevents host node_modules from overriding)
|
|
# - -w /app: Set working directory
|
|
docker run --rm -it --ipc=host \
|
|
-v "$(pwd):/app" \
|
|
-v /app/node_modules \
|
|
-w /app \
|
|
bitvid-playwright \
|
|
$CMD
|