restreamer-ui-v2/Dockerfile

51 lines
1.5 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

ARG CADDY_IMAGE=caddy:2.8.4-alpine
ARG NODE_IMAGE=node:21-alpine3.20
# ── Stage 1: Install server deps (tiny only express+cors) ──────────────────
FROM $NODE_IMAGE AS server-deps
WORKDIR /srv
COPY server/package.json server/package-lock.json* ./
RUN npm install --omit=dev --no-audit --prefer-offline
# ── Stage 2: Production image (Caddy + Node.js) ───────────────────────────────
FROM $CADDY_IMAGE
# Install Node.js and ffmpeg to run the Facebook OAuth2 microserver + relay
RUN apk add --no-cache nodejs ffmpeg
# Copy pre-built React app (built on host with: npm run build / yarn build)
COPY build /ui/build
# Copy Caddy config
COPY Caddyfile /ui/Caddyfile
# Copy Node.js FB server + its deps
COPY server /ui/server
COPY --from=server-deps /srv/node_modules /ui/server/node_modules
# Copy entrypoint script
COPY docker-entrypoint.sh /ui/docker-entrypoint.sh
RUN chmod +x /ui/docker-entrypoint.sh
# Persistent volume for FB OAuth2 tokens (config.json)
VOLUME ["/data/fb"]
WORKDIR /ui
EXPOSE 3000
# Runtime environment variables (overridden at runtime via -e or docker-compose)
ENV CORE_ADDRESS=""
ENV YTDLP_URL=""
ENV FB_SERVER_URL=""
ENV YTDLP_HOST="192.168.1.20:8282"
ENV RTMP_HOST="127.0.0.1"
ENV RTMP_PORT="1935"
ENV RTMP_APP="live"
ENV FFMPEG_BIN="ffmpeg"
ENV LIVEKIT_API_KEY=""
ENV LIVEKIT_API_SECRET=""
ENV LIVEKIT_WS_URL=""
CMD ["/ui/docker-entrypoint.sh"]