From f4521782be30717f4f13a6a624ecfc3d68fb34b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Wei=C3=9F?= Date: Mon, 24 Nov 2025 20:58:24 +0100 Subject: [PATCH] first commit --- .gitignore | 1 + Dockerfile | 22 ++++++++++++++++++++++ docker-compose.yml | 19 +++++++++++++++++++ entrypoint.sh | 11 +++++++++++ 4 files changed, 53 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 entrypoint.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4c70edc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:22.04 as final + +ARG RUNNER_VERSION=0.2.13 + +# needed always +RUN apt-get update && \ + apt-get install wget curl software-properties-common golang -y && \ + cd ~ && curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh && \ + bash nodesource_setup.sh && apt install nodejs + +RUN mkdir -p /app && \ + chmod -R 777 /app && \ + mkdir /config && \ + chmod 777 /config + +RUN wget "https://gitea.com/gitea/act_runner/releases/download/v${RUNNER_VERSION}/act_runner-${RUNNER_VERSION}-linux-amd64" && \ + mv "act_runner-${RUNNER_VERSION}-linux-amd64" "/app/act_runner" && \ + chmod 777 /app/act_runner + +COPY "./entrypoint.sh" "/app/entrypoint.sh" + +ENTRYPOINT "/app/entrypoint.sh" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..36b5e85 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +services: + + # when you want to rebuild the runner (this creates a new runner) run: + # sudo docker compose up --build -d + gitea-runner-dotnet: + container_name: "gitea-runner-dotnet" + restart: unless-stopped + build: + context: . + volumes: + #- /var/run/docker.sock:/var/run/docker.sock + #- ./config:/config + - ./data:$HOME/.cache + - ./configs/NuGet:/root/.nuget/NuGet + environment: + GITEA_INSTANCE_URL: "http://gitea.int.boger.local" + GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_REG_TOKEN} + GITEA_RUNNER_NAME: "gitea-runner-dotnet" + GITEA_RUNNER_LABELS: "dotnet-10,ubuntu2204" \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..b2d88a0 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "Connecting to ${GITEA_INSTANCE_URL}" + +if ! test -f .runner; then + echo "No .runner file detected, running registration" + /app/act_runner register --instance "${GITEA_INSTANCE_URL}" --token "${GITEA_RUNNER_REGISTRATION_TOKEN}" --name "${GITEA_RUNNER_NAME}" --labels "${GITEA_RUNNER_LABELS}" --no-interactive + touch /.runner +fi + +/app/act_runner daemon \ No newline at end of file