ffmpeg-rust / Dockerfile
YTShortMakerArchx's picture
Update Dockerfile
6236c5b verified
Raw History Blame Contribute Delete
1.34 kB
# ArchNemix FFmpeg Backend - Rust v5.1.0
# HuggingFace Spaces Dockerfile
FROM rust:1.85-slim-bullseye AS builder
# Install build dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Copy manifests
COPY Cargo.toml ./
# Copy source code (main.rs in root)
COPY main.rs ./
# Build for release (optimized binary)
RUN cargo build --release
# =============================================================================
# Runtime Stage
# =============================================================================
FROM debian:bullseye-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Verify FFmpeg installation
RUN ffmpeg -version && ffprobe -version
# Create app directory
WORKDIR /app
# Copy compiled binary from builder
COPY --from=builder /app/target/release/archnemix-ffmpeg-rust /app/archnemix-ffmpeg-rust
# Create required directories
RUN mkdir -p /tmp/audio /tmp/out /tmp/jobs /tmp/clients /tmp/hf_cache && \
chmod -R 777 /tmp
# Expose port (HuggingFace Spaces standard)
EXPOSE 7860
# Set environment variables
ENV RUST_LOG=info \
PORT=7860
# Run the application
CMD ["/app/archnemix-ffmpeg-rust"]