Spaces:
Runtime error
Runtime error
Create files/Dockerfile
Browse files- files/Dockerfile +38 -0
files/Dockerfile
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:20-slim
|
| 2 |
+
|
| 3 |
+
# Install ffmpeg and system utilities
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
ffmpeg \
|
| 6 |
+
procps \
|
| 7 |
+
curl \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
WORKDIR /app
|
| 11 |
+
|
| 12 |
+
# Copy package files first for layer caching
|
| 13 |
+
COPY package.json ./
|
| 14 |
+
|
| 15 |
+
# Install dependencies
|
| 16 |
+
RUN npm install --omit=dev
|
| 17 |
+
|
| 18 |
+
# Copy application files
|
| 19 |
+
COPY server.js ./server.js
|
| 20 |
+
|
| 21 |
+
# Create required directories
|
| 22 |
+
RUN mkdir -p others/temp others/songs others/hls others/data
|
| 23 |
+
|
| 24 |
+
# HuggingFace Spaces runs on port 7860 by default
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
# Environment variables that MUST be set as HuggingFace Space secrets:
|
| 28 |
+
# CONSTITUENT_OWNER_ID β the userId from your main DB who owns this space
|
| 29 |
+
# MAIN_SERVER_SECRET β shared secret so only your main server can call add-movie
|
| 30 |
+
# TMDB_KEY β (optional) for TMDB enrichment
|
| 31 |
+
ENV PORT=7860
|
| 32 |
+
ENV NODE_ENV=production
|
| 33 |
+
|
| 34 |
+
# Health check β HuggingFace polls this to decide if the space is healthy
|
| 35 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 36 |
+
CMD curl -f http://localhost:7860/constituent/health || exit 1
|
| 37 |
+
|
| 38 |
+
CMD ["node", "server.js"]
|