A containerized solution for viewing and analyzing Google Lighthouse reports. This project provides a Docker image that runs a Lighthouse Viewer server, making it easy to host your own instance for viewing Lighthouse performance reports.
- Self-hosted Lighthouse report viewer
- Dockerized for easy deployment
- Lightweight and fast
- Compatible with standard Lighthouse JSON reports
- Port 7333 exposed for web access
- Docker installed on your system
- Basic understanding of Docker commands
- Lighthouse JSON reports you want to view
- Clone the repository:
git clone https://github.com/yourusername/lighthouse-viewer-docker.git
cd lighthouse-viewer-docker
- Build the Docker image:
docker build -t lighthouse-viewer .
- Run the container:
docker run -p 7333:7333 -d --name lighthouse-viewer lighthouse-viewer
The viewer will be available at http://localhost:7333
The project includes integration tests for both Caddy and Nginx server implementations. To run the tests:
- Make sure Docker is running on your system
- Execute the test script:
./run-tests.sh
This will:
- Build and test the Caddy implementation
- Build and test the Nginx implementation
- Provide detailed output for each test stage
- Clean up test containers and images automatically
The tests verify:
- Docker image builds successfully
- Container starts properly
- Server is accessible on the configured port
- Health checks pass
- Basic HTTP functionality works
If any test fails, you'll see detailed error output to help with debugging.
You can test the GitHub workflows locally before pushing changes using act. This ensures your CI pipeline works as expected:
- Install
act
(on macOS):
brew install act
- Run the workflow:
act -v --container-architecture linux/amd64
This will:
- Run the entire workflow locally
- Execute all test stages
- Show detailed output for each step
- Clean up resources automatically
The -v
flag provides verbose output, helpful for debugging, and the --container-architecture
flag ensures compatibility with M1/M2 Macs.
Common issues and solutions:
- If you get Docker permission errors, ensure your user has proper Docker permissions
- For memory issues, adjust Docker's resource limits in Docker Desktop settings
- If tests fail, check the verbose output for specific error messages
By default, the server runs on port 7333. You can modify the port mapping when running the container:
docker run -p <your-desired-port>:7333 -d --name lighthouse-viewer lighthouse-viewer
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Please make sure to update tests as appropriate and follow the existing code style.
This project is licensed under the MIT License - see the LICENSE file for details.
Give a ⭐️ if this project helped you!
If you have any questions or suggestions, please open an issue in the repository.
- Google Lighthouse team for creating the excellent Lighthouse tool