clippy / Dockerfile
txtorg's picture
Upload constituent server files
4e3b382 verified
Raw
History Blame Contribute Delete
1.64 kB
# ═══════════════════════════════════════════════════════════════════════════
# CONSTITUENT DOCKERFILE
# HuggingFace Docker Space β€” Node.js + FFmpeg streaming server
# ═══════════════════════════════════════════════════════════════════════════
FROM node:20-slim
# Install ffmpeg and system utilities
RUN apt-get update && apt-get install -y \
ffmpeg \
procps \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy package files first for layer caching
COPY package.json ./
# Install dependencies
RUN npm install --omit=dev
# Copy application files
COPY server.js ./server.js
# Create required directories
RUN mkdir -p others/temp others/songs others/hls others/data
# HuggingFace Spaces runs on port 7860 by default
EXPOSE 7860
# Environment variables that MUST be set as HuggingFace Space secrets:
# CONSTITUENT_OWNER_ID β€” the userId from your main DB who owns this space
# MAIN_SERVER_SECRET β€” shared secret so only your main server can call add-movie
# TMDB_KEY β€” (optional) for TMDB enrichment
ENV PORT=7860
ENV NODE_ENV=production
# Health check β€” HuggingFace polls this to decide if the space is healthy
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:7860/constituent/health || exit 1
CMD ["node", "server.js"]