💾 Archived View for wilw.capsule.town › notes › gitea.gmi captured on 2023-11-14 at 08:10:01. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-04-19)
-=-=-=-=-=-=-
Gitea [1] is a fantastic GitHub-like service for git remotes and for viewing code and git projects via a web-browser. One can join existing instances (such as Codeberg [2]), or self-host it.
I self-host a Gitea instance [3]. I use a `docker-compose.yml` file like the one below.
version: "3" services: gitea: image: gitea/gitea:latest restart: unless-stopped environment: - USER_UID=1000 - USER_GID=1000 networks: - traefik_net volumes: - ./gitea_data:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "22:22" expose: - 3000 labels: - traefik.http.routers.gitea.rule=Host(`domain.com`) - traefik.http.routers.gitea.tls=true - traefik.http.routers.gitea.tls.certresolver=myresolver - traefik.http.services.gitea.loadbalancer.server.port=3000 networks: traefik_net: external: true
Change the domain at which you host the instance and setup the DNS/labels as described in the Traefik [4] note.
Then, bring the service up and navigate to it with a web-browser to complete the setup.
You may notice an additional Traefik label (the `loadbalancer.server.port`) not usually required. Since Gitea exposes a web interface (on port 3000) as well as the SSH git interface (on port 22), we need to tell Traefik to route web traffic to the correct port.
I map the SSH git port to port 22 on the host to make git syncing easier.
I recommend uisng the filesystem backup strategy described in the backups note [5] to back-up the `gitea_data/` directory.