gaming-hub/Dockerfile
Daniel 9689af4d3a Add: Automatische Versionierung via VERSION-Datei
- VERSION-Datei als Single Source of Truth (startet bei 1.5.1)
- CI liest Version aus Datei statt hardcoded
- Patch-Version wird nach Deploy automatisch gebumpt
- Commit mit [skip ci] verhindert Endlosschleife
2026-03-07 14:17:27 +01:00

45 lines
1.9 KiB
Docker

FROM node:24-slim AS web-build
WORKDIR /app/web
COPY web/package*.json ./
RUN npm install --no-audit --no-fund
COPY web/ .
ARG VITE_BUILD_CHANNEL=stable
ARG VITE_APP_VERSION=dev
ENV VITE_BUILD_CHANNEL=$VITE_BUILD_CHANNEL
ENV VITE_APP_VERSION=$VITE_APP_VERSION
RUN npm run build
FROM node:24-slim AS server-build
WORKDIR /app/server
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
COPY server/package*.json ./
RUN npm install --no-audit --no-fund
COPY server/ .
RUN npm run build
RUN rm -rf node_modules && npm install --omit=dev --no-audit --no-fund
FROM debian:bookworm-slim AS ffmpeg-fetch
RUN apt-get update && apt-get install -y --no-install-recommends curl xz-utils ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& curl -L https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz \
-o /tmp/ffmpeg.tar.xz \
&& mkdir -p /tmp/ffmpeg \
&& tar -xJf /tmp/ffmpeg.tar.xz -C /tmp/ffmpeg --strip-components=2 --wildcards "*/bin/ffmpeg" \
&& chmod +x /tmp/ffmpeg/ffmpeg \
&& rm /tmp/ffmpeg.tar.xz
FROM node:24-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production PORT=8080 DATA_DIR=/data
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl \
&& curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux -o /usr/local/bin/yt-dlp \
&& chmod a+rx /usr/local/bin/yt-dlp \
&& apt-get purge -y curl && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
COPY --from=ffmpeg-fetch /tmp/ffmpeg/ffmpeg /usr/local/bin/ffmpeg
COPY --from=server-build /app/server/dist ./server/dist
COPY --from=server-build /app/server/node_modules ./server/node_modules
COPY --from=server-build /app/server/package.json ./server/package.json
COPY --from=web-build /app/web/dist ./web/dist
EXPOSE 8080
VOLUME ["/data"]
CMD ["node", "server/dist/index.js"]