Create Dockerfile
Browse files- Dockerfile +38 -0
Dockerfile
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ArchNemix FFmpeg Backend - Node.js v5.1.0
|
| 2 |
+
# HuggingFace Spaces Dockerfile
|
| 3 |
+
|
| 4 |
+
FROM node:18-bullseye
|
| 5 |
+
|
| 6 |
+
# Install FFmpeg and dependencies
|
| 7 |
+
RUN apt-get update && apt-get install -y \
|
| 8 |
+
ffmpeg \
|
| 9 |
+
curl \
|
| 10 |
+
ca-certificates \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# Verify FFmpeg installation
|
| 14 |
+
RUN ffmpeg -version && ffprobe -version
|
| 15 |
+
|
| 16 |
+
# Set working directory
|
| 17 |
+
WORKDIR /app
|
| 18 |
+
|
| 19 |
+
# Copy package files
|
| 20 |
+
COPY package.json package-lock.json* ./
|
| 21 |
+
|
| 22 |
+
# Install dependencies
|
| 23 |
+
RUN npm install --production
|
| 24 |
+
|
| 25 |
+
# Copy application code
|
| 26 |
+
COPY ffmpeg_nodejs_mirror.js ./
|
| 27 |
+
|
| 28 |
+
# Create required directories
|
| 29 |
+
# HuggingFace Spaces uses /data for persistent storage and /tmp for temporary files
|
| 30 |
+
RUN mkdir -p /tmp/audio /tmp/out /tmp/jobs /tmp/clients /tmp/hf_cache && \
|
| 31 |
+
chmod -R 777 /tmp
|
| 32 |
+
|
| 33 |
+
# HuggingFace Spaces exposes port 7860 by default
|
| 34 |
+
EXPOSE 7860
|
| 35 |
+
|
| 36 |
+
# Run the application
|
| 37 |
+
# HuggingFace Spaces will inject secrets as environment variables automatically
|
| 38 |
+
CMD ["node", "ffmpeg_nodejs_mirror.js"]
|