- Docker installed
- Docker Compose installed
-
Clone the repository (if not already done).
-
Configure Environment:
cp .env.example .env # Edit .env to set your secrets -
Prepare Directories:
# Create data directory for database persistence mkdir -p data # Create repos directory (or use existing path) mkdir -p repos
-
Start the Service:
docker-compose up -d
-
Access the Application: Open browser at
http://localhost:8080
The docker-compose.yml defines three key volumes:
-
Database Storage (
./data):- Maps to
/app/datain container. - Persists the SQLite database (
git_sync.db).
- Maps to
-
SSH Keys (
~/.ssh):- Maps host's SSH keys to
/root/.sshin container (Read-Only). - Allows the tool to use your existing SSH keys for Git authentication.
- Note: Ensure your host SSH keys have correct permissions.
- Maps host's SSH keys to
-
Repositories (
./repos):- Maps to
/reposin container. - This is where you should clone/store your git repositories.
- When registering a repo in the UI, use the container path (e.g.,
/repos/my-project).
- Maps to
To ensure the container can access private repositories via SSH:
-
Host Keys: The default configuration mounts
~/.sshfrom host to/root/.sshin container.- Ensure your
id_rsa(or other key) exists on host. - Ensure
known_hostscontains the git server fingerprints (e.g., GitHub, GitLab).
- Ensure your
-
Permissions: Docker typically mounts with root permissions. If you encounter permission issues:
# On Host chmod 600 ~/.ssh/id_rsa
-
Known Hosts: If the container complains about "Host key verification failed", you can manually add the host key in the container or ensure your host's
known_hostsis populated.Auto-scan inside container:
docker exec -it git-manage-service ssh-keyscan github.com >> /root/.ssh/known_hosts
- Database Errors: Check write permissions on
./datadirectory. - Git Errors: Check
docker logs git-manage-servicefor detailed git output (enable Debug Mode in UI settings). - Timezone: Default is
Asia/Shanghai. ChangeTZindocker-compose.ymlif needed.