Using Gitea as the central platform for managing personal projects
For every personal project like my Dotfiles, NixOS configuration, and even my CAD files I've got a git repository on my self-hosted Gitea instance. Gitea is a lightweight alternative to Gitlab written in Go. On my server, Gitea uses about 12.5% the memory footprint in comparison to Gitlab which is a big advantage especially in times of very high RAM prices.
The setup with docker-compose is very simple. By default Gitea uses a SQLite databate stored at ./gitea (mounted to /data inside the container) but it can also be configured to use MySQL or PostgreSQL.1 Here is an example compose.yaml which exposes the HTTP and SSH port to the outside of the container (make sure to configure the host's SSH server in advance to use a different port):
---
services:
gitea:
image: docker.gitea.com/gitea:latest
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
restart: unless-stopped
volumes:
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "80:3000"
- "22:22"
Gitea also comes with a package registry which is working out of the box. This allows you to host your own custom docker containers in Gitea which I will cover in future blog posts. You just have to login with your credentials and upload an image.
docker login [url]
docker push [image]