Replace with compose

This commit is contained in:
Aram 🍐 2025-08-23 22:08:47 -04:00
parent 8ed5786f19
commit 83f85c36dc
5 changed files with 27 additions and 56 deletions

View file

@ -1,6 +1,6 @@
# Forgejo Runner Quadlets
# Forgejo Runner with Podman
My configurations for running a Forgejo Runner with root-less Podman Quadlets. This configuration enables Actions to build container images using `buildah`.
My configurations for running a Forgejo Runner with root-less Podman Compose. This configuration enables Actions to build container images using `buildah`.
```mermaid
architecture-beta
@ -20,18 +20,16 @@ architecture-beta
## Set-up
Install podman:
Install podman and podman-compose:
```sh
sudo apt-get update && sudo apt-get install -y podman
sudo apt-get update && sudo apt-get install -y podman podman-compose
```
Create the data directories (`/data`) for persisting Forgejo runner configurations and cache:
```sh
sudo mkdir -p /data/.cache /data/.config
sudo touch /data/.runner
sudo chown -R $UID:$UID /data
sudo chmod -R 700 /data
@ -40,7 +38,7 @@ sudo chmod -R 700 /data
Clone this repository:
```sh
git clone https://git.poire.dev/aramperes/forgejo-runner-quadlet.git
git clone https://git.poire.dev/aramperes/forgejo-runner-podman.git
```
For the first-time set-up, you will need to stop the Forgejo Runner from starting up so you can configure the token with your Forgejo server.
@ -204,4 +202,4 @@ If you would like to modify the quadlet configurations, you will need to run the
systemctl --user daemon-reload
systemctl --user restart podman-runtime.service
systemctl --user restart forgejo-runner.service
```
```

21
docker-compose.yml Normal file
View file

@ -0,0 +1,21 @@
services:
runtime:
container_name: podman-runtime
image: quay.io/podman/stable
command: podman system service --time=0 tcp:0.0.0.0:2375
user: 1000
devices:
- /dev/fuse:/dev/fuse
restart: always
runner:
container_name: forgejo-runner
image: data.forgejo.org/forgejo/runner:9
command: /bin/sh -c "sleep 5; forgejo-runner daemon -c .config/config.yml"
user: 1001
volumes:
- /data:/data:U
environment:
- DOCKER_HOST=tcp://podman-runtime:2375
restart: always
# Exec=/bin/sh -c "while : ; do sleep 1 ; done ;"

View file

@ -1,22 +0,0 @@
[Unit]
Description=Forgejo Runner
After=podman-runtime.service
Requires=podman-runtime.service
[Container]
Image=data.forgejo.org/forgejo/runner:9
Exec=/bin/sh -c "sleep 5; forgejo-runner daemon -c .config/config.yml"
# Exec=/bin/sh -c "while : ; do sleep 1 ; done ;"
Network=runner.network
NetworkAlias=forgejo-runner
Volume=/data:/data:U
User=1001
Group=1001
Environment=DOCKER_HOST=tcp://podman-runtime:2375
StopTimeout=10
[Service]
Restart=always
[Install]
WantedBy=default.target

View file

@ -1,18 +0,0 @@
[Unit]
Description=Rootless Podman Runtime
After=network.target
[Container]
Image=quay.io/podman/stable
Exec=podman system service --time=0 tcp:0.0.0.0:2375
Network=runner.network
NetworkAlias=podman-runtime
User=1000
Group=1000
AddDevice=/dev/fuse
[Service]
Restart=always
[Install]
WantedBy=default.target

View file

@ -1,8 +0,0 @@
[Unit]
Description=Network for Forgejo runner and Podman service
[Network]
Driver=bridge
[Install]
WantedBy=default.target