A web application for generating Git repository statistics using Docker.
- Docker
docker run -d --name gitstats -p 5000:5000 -e PLATFORM=WINDOWS -e REPOSITORY_ROOT_PATH=/mnt/host -e OUTPUT_ROOT_PATH=/mnt/host -e MOUNT_PATH=/mount -v /:/mount:rw --privileged yinshe/gitstatsdocker run -d --name gitstats -p 5000:5000 -e PLATFORM=LINUX -e REPOSITORY_ROOT_PATH=/ -e OUTPUT_ROOT_PATH=/ -e MOUNT_PATH=/mount -v /:/mount:rw --privileged yinshe/gitstatsOpen your browser and navigate to http://localhost:5000
The application can be configured through environment variables in docker-compose.yml:
environment:
- PLATFORM=WINDOWS # Platform type (WINDOWS or LINUX)
- REPOSITORY_ROOT_PATH=/ # Root path for repository browsing
- OUTPUT_ROOT_PATH=/ # Root path for output files
- MOUNT_PATH=/mount # Mount point for host filesystem
volumes:
- /:/mount:rw # Mount host filesystemThe application mounts the entire host filesystem to /mount inside the container:
- This allows browsing and accessing files on your host machine
- The mount is read-write (
:rw), allowing generation of statistics reports - All paths in the application are relative to this mount point
For Windows users, the standard configuration is:
environment:
- PLATFORM=WINDOWS
- REPOSITORY_ROOT_PATH=/mnt/host
- OUTPUT_ROOT_PATH=/mnt/host
- MOUNT_PATH=/mount
volumes:
- /:/mount:rwThis is the standard configuration because:
REPOSITORY_ROOT_PATH=/mnt/hostandOUTPUT_ROOT_PATH=/mnt/host:- Provides access to the entire host filesystem
- Works consistently across different Windows versions
- Maintains compatibility with Docker's WSL2 backend
- The application will automatically:
- Convert Windows paths (e.g.,
C:\Users\Projects) to Linux format (/mnt/host/c/Users/Projects) - Display paths in Windows format in the UI
- Handle path conversions internally
- Convert Windows paths (e.g.,
-
PLATFORM- Purpose: Specifies the operating system platform
- Values:
WINDOWSorLINUX - Default:
LINUX - Note: Affects how paths are displayed and handled in the UI
-
REPOSITORY_ROOT_PATH- Purpose: Defines the root directory for browsing Git repositories
- Default:
/ - Note: This path should be relative to the mounted host filesystem
-
OUTPUT_ROOT_PATH- Purpose: Specifies where generated statistics reports will be saved
- Default:
/ - Note: This path should be relative to the mounted host filesystem
-
MOUNT_PATH- Purpose: Sets the mount point for accessing host filesystem
- Default:
/mount - Note: This is the base path where the host filesystem is mounted inside the container
-
If the container fails to start:
- Check if port 5000 is available
- Ensure Docker has necessary permissions
- Check container logs:
docker compose logs
-
If file access fails:
- Verify mount permissions
- Check if paths are correctly formatted for your platform
- Ensure Docker has access to the mounted directories
This project is licensed under the GNU General Public License v3.0 (GPL-3.0) - see the LICENSE file for details.