Files
Git-docker-server/README.md
T

51 lines
1.6 KiB
Markdown

# Local Git Server
A self-hosted Git server powered by Gitea with a GitHub-style web interface, repository browsing, issues, pull requests, actions, releases, and SSH/HTTP Git access.
## Start it
1. Copy `.env.example` to `.env`.
2. Change `POSTGRES_PASSWORD` in `.env` to a long random value.
3. Start the stack:
```powershell
docker compose up -d
```
4. Open [http://localhost:3000](http://localhost:3000).
5. Create the first account. The first account becomes an administrator.
The Git SSH endpoint is available on port `2222`:
```powershell
git clone ssh://git@localhost:2222/your-user/your-repository.git
```
HTTPS cloning is also available from the repository page:
```powershell
git clone http://localhost:3000/your-user/your-repository.git
```
## Useful commands
```powershell
# View service logs
docker compose logs -f gitea
# Stop containers but keep repositories and database data
docker compose down
# Stop containers and permanently delete all Git data
docker compose down
Remove-Item -Recurse -Force .\docker
```
## Production notes
- Put Gitea behind HTTPS with a reverse proxy before exposing it to the internet.
- Use a managed or separately backed-up PostgreSQL instance for important repositories.
- Set `DISABLE_REGISTRATION=true` and `REQUIRE_SIGNIN_VIEW=true` for a private team server.
- All persistent data, including repositories, Gitea configuration, attachments, and PostgreSQL data, is stored in `docker/`. Stop the stack with `docker compose down`, then back up or move that directory together with `.env` and `docker-compose.yml`.
- Update `GITEA_ROOT_URL` and `GITEA_DOMAIN` to the public hostname before deploying.