Update Dockerfile and environment configuration for Gitea runner and Flutter CI integration

This commit is contained in:
Nils-Johan Gynther
2026-05-12 21:38:37 +02:00
parent a6309679f7
commit 530f990395
5 changed files with 61 additions and 16 deletions
+1 -1
View File
@@ -14,4 +14,4 @@ GITEA_RUNNER_NAME=recipe-app
# Runner labels (optional, defaults to ubuntu-latest if empty) # Runner labels (optional, defaults to ubuntu-latest if empty)
# Format: label:docker://image,label:docker://image # Format: label:docker://image,label:docker://image
GITEA_RUNNER_LABELS=backend-node24:docker://node:24-bullseye,flutter-3-41:docker://ghcr.io/cirruslabs/flutter:stable GITEA_RUNNER_LABELS=backend-node24:docker://node:24.15.0-bullseye,flutter-3-41:docker://recipe-flutter-ci:3.41-node24
+10 -5
View File
@@ -1,11 +1,16 @@
FROM gitea/act_runner:latest ARG ACT_RUNNER_VERSION=0.2.11
FROM gitea/act_runner:${ACT_RUNNER_VERSION}
USER root USER root
# Docker CLI behövs för shell-jobb som kör docker-kommandon direkt # Basverktyg för robusta shell-workflows och JS-baserade actions.
# openssh-client behövs för deployment-scripts via SSH
# curl allmänt användbart i workflow-steg
RUN apk add --no-cache \ RUN apk add --no-cache \
bash \
ca-certificates \
curl \ curl \
docker-cli \ docker-cli \
openssh-client git \
nodejs \
npm \
openssh-client \
&& update-ca-certificates
+20 -7
View File
@@ -49,16 +49,24 @@ Sätt dessa värden:
GITEA_INSTANCE_URL=https://gitea.gynther.se GITEA_INSTANCE_URL=https://gitea.gynther.se
GITEA_RUNNER_REGISTRATION_TOKEN=<din-token-här> GITEA_RUNNER_REGISTRATION_TOKEN=<din-token-här>
GITEA_RUNNER_NAME=recipe-app GITEA_RUNNER_NAME=recipe-app
GITEA_RUNNER_LABELS=backend-node24:docker://node:24-bullseye,flutter-3-41:docker://ghcr.io/cirruslabs/flutter:stable GITEA_RUNNER_LABELS=backend-node24:docker://node:24.15.0-bullseye,flutter-3-41:docker://recipe-flutter-ci:3.41-node24
``` ```
### 4. Starta runnern ### 4. Bygg lokal Flutter CI-image
Flutter-jobben blir stabilare om de körs i en image med både Flutter + Node.js + Git.
```bash
docker build -f images/flutter-ci/Dockerfile -t recipe-flutter-ci:3.41-node24 .
```
### 5. Starta runnern
```bash ```bash
docker compose up -d docker compose up -d
``` ```
### 5. Verifiera att den är online ### 6. Verifiera att den är online
```bash ```bash
docker compose logs -f docker compose logs -f
@@ -93,8 +101,8 @@ docker compose down -v
Workflown i `recipe-app` definieras i [recipe-app/.gitea/workflows/test.yml](../recipe-app/.gitea/workflows/test.yml). Workflown i `recipe-app` definieras i [recipe-app/.gitea/workflows/test.yml](../recipe-app/.gitea/workflows/test.yml).
Aktuella labels: Aktuella labels:
- **`backend-node24`**: Node.js 24 i Bullseye — för backend-jobb (build, test, linting) - **`backend-node24`**: Node.js 24.15 i Bullseye — för backend-jobb (build, test, linting)
- **`flutter-3-41`**: Flutter 3.41 — för Flutter-jobb (analyze, test) - **`flutter-3-41`**: Lokal image `recipe-flutter-ci:3.41-node24` med Flutter + Node + Git + Bash
Om en workflow kör med `runs-on: backend-node24` eller `runs-on: flutter-3-41`, kommer denna runner att köra jobbet i motsvarande Docker-image. Om en workflow kör med `runs-on: backend-node24` eller `runs-on: flutter-3-41`, kommer denna runner att köra jobbet i motsvarande Docker-image.
@@ -119,8 +127,13 @@ Säkra att workflow använder en av de definierade labels. Om `runs-on` matchar
**Verifiera Docker-image:** **Verifiera Docker-image:**
```bash ```bash
docker pull node:24-bullseye docker pull node:24.15.0-bullseye
docker pull ghcr.io/cirruslabs/flutter:stable docker image inspect recipe-flutter-ci:3.41-node24
```
Om flutter-image saknas:
```bash
docker build -f images/flutter-ci/Dockerfile -t recipe-flutter-ci:3.41-node24 .
``` ```
### Token är exponerad ### Token är exponerad
+12 -3
View File
@@ -7,13 +7,22 @@ services:
container_name: gitea-runner container_name: gitea-runner
restart: unless-stopped restart: unless-stopped
environment: environment:
GITEA_INSTANCE_URL: ${GITEA_INSTANCE_URL} GITEA_INSTANCE_URL: ${GITEA_INSTANCE_URL:?Set GITEA_INSTANCE_URL in .env}
GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_RUNNER_REGISTRATION_TOKEN} GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_RUNNER_REGISTRATION_TOKEN:?Set GITEA_RUNNER_REGISTRATION_TOKEN in .env}
GITEA_RUNNER_NAME: ${GITEA_RUNNER_NAME:-recipe-app} GITEA_RUNNER_NAME: ${GITEA_RUNNER_NAME:-recipe-app}
GITEA_RUNNER_LABELS: ${GITEA_RUNNER_LABELS:-backend-node24:docker://node:24-bullseye,flutter-3-41:docker://ghcr.io/cirruslabs/flutter:stable} GITEA_RUNNER_LABELS: ${GITEA_RUNNER_LABELS:-backend-node24:docker://node:24.15.0-bullseye,flutter-3-41:docker://recipe-flutter-ci:3.41-node24}
volumes: volumes:
- runner-data:/data - runner-data:/data
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
healthcheck: healthcheck:
test: ["CMD-SHELL", "pgrep -x act_runner > /dev/null || exit 1"] test: ["CMD-SHELL", "pgrep -x act_runner > /dev/null || exit 1"]
interval: 30s interval: 30s
+18
View File
@@ -0,0 +1,18 @@
ARG FLUTTER_BASE_IMAGE=ghcr.io/cirruslabs/flutter:stable
FROM ${FLUTTER_BASE_IMAGE}
USER root
# Flutter-jobb i Gitea Actions behöver ofta även Node.js + Git + Bash.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
ca-certificates \
curl \
git \
nodejs \
npm \
openssh-client \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace