Quellcode wird nun beim Build geladen

This commit is contained in:
2026-04-22 14:45:38 +02:00
parent a981953c9a
commit a36abb12ff
4 changed files with 31 additions and 13 deletions

View File

@@ -7,4 +7,3 @@ CONTRIBUTING.md
docker-compose.yml
.ki-workspace
*.md
!vdo-ninja-source/**/*.md

View File

@@ -56,12 +56,6 @@ jobs:
echo "should_build=true" >> "$GITHUB_OUTPUT"
fi
- name: VDO.Ninja Quellcode klonen
if: steps.check.outputs.should_build == 'true'
run: |
git clone --depth 1 ${{ env.UPSTREAM_REPO }} vdo-ninja-source
echo "VDO.Ninja Commit: $(cd vdo-ninja-source && git rev-parse --short HEAD)"
- name: Bei Gitea Registry einloggen
if: steps.check.outputs.should_build == 'true'
run: |
@@ -74,6 +68,8 @@ jobs:
if: steps.check.outputs.should_build == 'true'
run: |
docker build \
--build-arg VDO_NINJA_REPO=${{ env.UPSTREAM_REPO }} \
--build-arg VDO_NINJA_REF=${{ steps.check.outputs.upstream_tag }} \
-t ${{ steps.check.outputs.registry }}/${{ secrets.REGISTRY_USER }}/${{ env.IMAGE_NAME }}:latest \
-t ${{ steps.check.outputs.registry }}/${{ secrets.REGISTRY_USER }}/${{ env.IMAGE_NAME }}:${{ steps.check.outputs.upstream_tag }} \
.

View File

@@ -2,6 +2,21 @@
# Basierend auf nginx:alpine für minimale Imagegröße
# Quelle: https://github.com/steveseguin/vdo.ninja
ARG VDO_NINJA_REPO=https://github.com/steveseguin/vdo.ninja
ARG VDO_NINJA_REF=
FROM alpine:3.20 AS source
ARG VDO_NINJA_REPO
ARG VDO_NINJA_REF
RUN apk add --no-cache ca-certificates git \
&& if [ -n "${VDO_NINJA_REF}" ]; then \
git clone --depth 1 --branch "${VDO_NINJA_REF}" "${VDO_NINJA_REPO}" /vdo-ninja-source; \
else \
git clone --depth 1 "${VDO_NINJA_REPO}" /vdo-ninja-source; \
fi
FROM nginx:alpine
LABEL maintainer="Patrick Asmus <support@techniverse.net>"
@@ -13,8 +28,8 @@ LABEL org.opencontainers.image.licenses="AGPL-3.0"
# Eigene nginx-Konfiguration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# VDO.Ninja Quelldateien (wird im CI-Workflow geklont)
COPY vdo-ninja-source/ /usr/share/nginx/html/
# VDO.Ninja Quelldateien aus dem Build-Stage übernehmen
COPY --from=source /vdo-ninja-source/ /usr/share/nginx/html/
# Nicht benötigte Dateien entfernen
RUN rm -rf /usr/share/nginx/html/.git \

View File

@@ -154,9 +154,6 @@ docker pull git.techniverse.net/scriptos/vdo-ninja:v29.0
Das Image kann auch lokal gebaut werden:
```bash
# VDO.Ninja Quellcode klonen
git clone --depth 1 https://github.com/steveseguin/vdo.ninja vdo-ninja-source
# Docker Image bauen
docker build -t vdo-ninja:local .
@@ -164,6 +161,17 @@ docker build -t vdo-ninja:local .
docker run -d -p 8080:80 --name vdo-ninja vdo-ninja:local
```
Der VDO.Ninja-Quellcode wird beim Build automatisch aus dem Upstream-Repository geladen. Ohne weitere Angaben wird der Default-Branch des Upstream-Repositories verwendet.
Optional kann ein bestimmter Branch oder Tag gebaut werden:
```bash
docker build \
--build-arg VDO_NINJA_REF=v29.0 \
-t vdo-ninja:v29.0 \
.
```
---
## 🛡️ Secrets & Variablen