simple image to run a gitolite instance with stagit as webfrontend
2.2K
A Docker-based Gitolite server with a static web interface powered by stagit.
Bug reports & feedback: github.com/cw4g/gitolite-feedback
main: New repositories use main as default branchCreate a docker-compose.yml:
services:
gitolite:
image: cw4g/gitolite
ports:
- "2222:22"
- "8080:80"
volumes:
- ./volume:/home/git
env_file:
- .env
Create a .env file:
USERNAME=your_username
SSH_PUBLIC_KEY="ssh-rsa AAAA... your-key"
Replace your_username with your desired admin username and paste your full SSH public key.
Start the container:
docker compose up -d
Access the services:
ssh://git@localhost:2222http://localhost:8080git clone ssh://git@localhost:2222/gitolite-admin
git clone ssh://git@localhost:2222/<repo-name>
To set a repository description that appears in the web interface, create a .description file in your repository root:
echo "My awesome project" > .description
git add .description
git commit -m "Add description"
git push
The description will be automatically picked up on the next push.
├── Dockerfile # Alpine-based image with Git, SSH, Gitolite, and Stagit
├── docker-compose.yml # Service configuration (ports 2222 for SSH, 8080 for web)
├── docker-entrypoint.sh # Container initialization script
├── stagit-gen.sh # Stagit page generator script
├── lighttpd.conf # Web server configuration
├── logo.png # Git logo for web interface
└── volume/ # Persistent data (mounted to /home/git)
├── host_keys/ # SSH host keys
├── repositories/ # Git repositories
└── .gitolite/ # Gitolite configuration and hooks
SSH host keys are persisted in ./volume/host_keys/. On first start, keys are generated and saved. On subsequent starts, existing keys are restored to prevent SSH fingerprint warnings.
.description file from repositoriesThe web interface is served by lighttpd on port 80 (mapped to 8080). It displays:
# Build the image
make build
# Start the container
make run
# Build and push to Docker Hub
make push
# Push README to Docker Hub
make push-readme
# Push image and README
make push-all
# View logs
docker-compose logs -f
# Stop the container
docker-compose down
# Manually regenerate stagit pages
docker-compose exec gitolite su git -c 'stagit-gen'
To use your own logo and favicon, add optional volume mounts to docker-compose.yml:
services:
gitolite:
image: cw4g/gitolite
ports:
- "2222:22"
- "8080:80"
volumes:
- ./volume:/home/git
# Optional: custom logo and favicon
- ./my-logo.png:/var/www/git/logo.png:ro
- ./my-favicon.png:/var/www/git/favicon.png:ro
env_file:
- .env
Recommended size: 32x32 pixels PNG.
To customize the dark theme, mount your own CSS file:
volumes:
- ./my-style.css:/var/www/git/style.css:ro
| Port | Service | Description |
|---|---|---|
| 2222 | SSH | Git SSH access |
| 8080 | HTTP | Stagit web interface |
MIT
Content type
Image
Digest
sha256:5bf1a1c4b…
Size
24.8 MB
Last updated
8 months ago
docker pull cw4g/gitolite