From c72697a3f7eacc91bb58f1ba5067faa47504b5ef Mon Sep 17 00:00:00 2001 From: Elias Ahokas Date: Mon, 24 Nov 2025 18:17:48 +0200 Subject: [PATCH] add services --- .env.example | 1 + .gitea/workflows/deploy.yml | 17 +++++++++++++++++ .gitignore | 1 + Dockerfile | 9 +++++++++ README.md | 16 ++++++++++++++++ docker-compose.yml | 18 ++++++++++++++++++ 6 files changed, 62 insertions(+) create mode 100644 .env.example create mode 100644 .gitea/workflows/deploy.yml create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..d4cc9b8 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +RUNNER_TOKEN=your_token_here \ No newline at end of file diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..a94363c --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,17 @@ +name: deploy core services + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + deploy: + runs-on: z420 + steps: + - name: deploy + run: | + cd /home/sirian/services/core + git pull origin main + docker compose pull + docker compose up -d --remove-orphans \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3cae294 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM gitea/act_runner:latest + +USER root + +RUN apk add --no-cache openssh-client git docker-cli docker-cli-compose + +RUN adduser -D -u 1000 -g 1000 sirian + +USER 1000 diff --git a/README.md b/README.md new file mode 100644 index 0000000..b20895e --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# Z420 core stack + +Core infrastructure for z420 home server + +## services + +- Gitea runner + +## setup + +1. Make .env file and fill with gitea runner token +2. Deploy with 'docker compose up -d' + +## data + +All data is stored in /var/lib/z420 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..35b8869 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + gitea-runner: + build: . + restart: unless-stopped + user: "1000:1000" + group_add: + - "996" + environment: + - GITEA_INSTANCE_URL=https://git.sirian.me + - GITEA_RUNNER_REGISTRATION_TOKEN=${RUNNER_TOKEN} + - GITEA_RUNNER_LABELS=z420 + - GITEA_RUNNER_NAME=z420-runner + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /var/lib/z420/gitea_runner:/data + - /var/lib/z420/gitea_runner/cache:/.cache + - /home/sirian/services:/home/sirian/services + - /home/sirian/.ssh:/home/sirian/.ssh:ro \ No newline at end of file