Forgejo
A good quadlet to run Forgejo:
# forgejo.container
[Unit]
Description=Forgejo Rootless Service
[Container]
ContainerName=forgejo
UserNS=keep-id:uid=1000,gid=1000
Environment=USER_UID=1000
Environment=USER_GID=1000
Image=codeberg.org/forgejo/forgejo:14-rootless
Network=caddy.network
PublishPort=2222:2222
Volume=%h/.config/containers/storage/forgejo/conf:/etc/gitea
Volume=%h/.config/containers/storage/forgejo:/var/lib/gitea
Volume=/etc/localtime:/etc/localtime:ro
[Service]
Restart=always
[Install]
WantedBy=default.target
copy this in
.config/containers/systemd/forgejo.container
some considerations
This is to run a rootless container. UserNS is there so that the user inside the container will have the same number as the user outside, or else the volume shall be set owned by user 100999.
Forgejo is served by a reverse proxy, Caddy in this case, so it stays in the proxy’s network.
The conf:/etc/gitea volume is kept empty, but it’s required in the documentation.
create directories
mkdir -p .config/containers/storage/forgejo/conf