rmm2/frontend/Dockerfile
cynfo3000 3afd5c8445
Some checks failed
Docker Images bauen und pushen / build-and-push (push) Has been cancelled
feat: fertige Docker Images via Gitea Actions + Runtime-Konfiguration
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
2026-03-08 19:42:56 +01:00

27 lines
509 B
Docker

FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# ---
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
# Konfiguration via ENV zur Laufzeit (kein Rebuild bei IP-Aenderung noetig)
ENV BACKEND_HOST=localhost \
BACKEND_PORT=8443 \
API_KEY=""
ENTRYPOINT ["/docker-entrypoint.sh"]