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 docker-compose.yml
.ki-workspace .ki-workspace
*.md *.md
!vdo-ninja-source/**/*.md

View File

@@ -56,12 +56,6 @@ jobs:
echo "should_build=true" >> "$GITHUB_OUTPUT" echo "should_build=true" >> "$GITHUB_OUTPUT"
fi 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 - name: Bei Gitea Registry einloggen
if: steps.check.outputs.should_build == 'true' if: steps.check.outputs.should_build == 'true'
run: | run: |
@@ -74,6 +68,8 @@ jobs:
if: steps.check.outputs.should_build == 'true' if: steps.check.outputs.should_build == 'true'
run: | run: |
docker build \ 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 }}:latest \
-t ${{ steps.check.outputs.registry }}/${{ secrets.REGISTRY_USER }}/${{ env.IMAGE_NAME }}:${{ steps.check.outputs.upstream_tag }} \ -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 # Basierend auf nginx:alpine für minimale Imagegröße
# Quelle: https://github.com/steveseguin/vdo.ninja # 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 FROM nginx:alpine
LABEL maintainer="Patrick Asmus <support@techniverse.net>" LABEL maintainer="Patrick Asmus <support@techniverse.net>"
@@ -13,8 +28,8 @@ LABEL org.opencontainers.image.licenses="AGPL-3.0"
# Eigene nginx-Konfiguration # Eigene nginx-Konfiguration
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
# VDO.Ninja Quelldateien (wird im CI-Workflow geklont) # VDO.Ninja Quelldateien aus dem Build-Stage übernehmen
COPY vdo-ninja-source/ /usr/share/nginx/html/ COPY --from=source /vdo-ninja-source/ /usr/share/nginx/html/
# Nicht benötigte Dateien entfernen # Nicht benötigte Dateien entfernen
RUN rm -rf /usr/share/nginx/html/.git \ 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: Das Image kann auch lokal gebaut werden:
```bash ```bash
# VDO.Ninja Quellcode klonen
git clone --depth 1 https://github.com/steveseguin/vdo.ninja vdo-ninja-source
# Docker Image bauen # Docker Image bauen
docker build -t vdo-ninja:local . 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 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 ## 🛡️ Secrets & Variablen
@@ -225,4 +233,4 @@ Dieses Repository (Dockerfile, Workflow, Konfiguration) steht unter der [MIT-Liz
<p align="center"> <p align="center">
<img src="https://assets.techniverse.net/f1/logos/small/license.png" alt="License" width="15" height="15"> <a href="./LICENSE">License</a> | <img src="https://assets.techniverse.net/f1/logos/small/matrix2.svg" alt="Matrix" width="15" height="15"> <a href="https://matrix.to/#/#community:techniverse.net">Matrix</a> | <img src="https://assets.techniverse.net/f1/logos/small/mastodon2.svg" alt="Mastodon" width="15" height="15"> <a href="https://social.techniverse.net/@donnerwolke">Mastodon</a> <img src="https://assets.techniverse.net/f1/logos/small/license.png" alt="License" width="15" height="15"> <a href="./LICENSE">License</a> | <img src="https://assets.techniverse.net/f1/logos/small/matrix2.svg" alt="Matrix" width="15" height="15"> <a href="https://matrix.to/#/#community:techniverse.net">Matrix</a> | <img src="https://assets.techniverse.net/f1/logos/small/mastodon2.svg" alt="Mastodon" width="15" height="15"> <a href="https://social.techniverse.net/@donnerwolke">Mastodon</a>
</p> </p>