feat: fertige Docker Images via Gitea Actions + Runtime-Konfiguration
Docker Images bauen und pushen / build-and-push (push) Has been cancelled

CI/CD:
- .gitea/workflows/docker-publish.yml: baut + pusht bei Push auf release und Tags
- Images: git.cynfo.net/christian/rmm2/backend:latest + frontend:latest
- Gitea Secrets: REGISTRY_USER + REGISTRY_PASSWORD gesetzt

Runtime-Konfiguration (kein Rebuild bei IP-Aenderung):
- frontend/docker-entrypoint.sh: generiert runtime-config.js aus ENV-Vars beim Start
- frontend/src/config.js: window.__RMM_CONFIG__ (Docker) vor Vite-ENV (in .gitignore, nicht im release-Commit)
- frontend/public/runtime-config.js: leerer Fallback fuer lokale Entwicklung
- frontend/index.html: laedt /runtime-config.js vor dem App-Bundle

docker-compose:
- Nutzt fertige Images aus der Gitea Registry
- docker-compose.build.yml: Override fuer lokalen Build
- Alle Frontend-Werte via ENV zur Laufzeit
This commit is contained in:
cynfo3000
2026-03-08 19:42:56 +01:00
parent 9d5f060cbd
commit 3afd5c8445
8 changed files with 111 additions and 20 deletions
+8 -11
View File
@@ -5,16 +5,6 @@ COPY package*.json ./
RUN npm ci
COPY . .
# Backend-URL wird zur Build-Zeit via ARG gesetzt
ARG VITE_BACKEND_HOST=localhost
ARG VITE_BACKEND_PORT=8443
ARG VITE_API_KEY=""
ENV VITE_BACKEND_HOST=$VITE_BACKEND_HOST \
VITE_BACKEND_PORT=$VITE_BACKEND_PORT \
VITE_API_KEY=$VITE_API_KEY
RUN npm run build
# ---
@@ -23,7 +13,14 @@ FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# Konfiguration via ENV zur Laufzeit (kein Rebuild bei IP-Aenderung noetig)
ENV BACKEND_HOST=localhost \
BACKEND_PORT=8443 \
API_KEY=""
ENTRYPOINT ["/docker-entrypoint.sh"]