Initial implementation of AudioCraft Studio
Complete web interface for Meta's AudioCraft AI audio generation: - Gradio UI with tabs for all 5 model families (MusicGen, AudioGen, MAGNeT, MusicGen Style, JASCO) - REST API with FastAPI, OpenAPI docs, and API key auth - VRAM management with ComfyUI coexistence support - SQLite database for project/generation history - Batch processing queue for async generation - Docker deployment optimized for RunPod with RTX 4090 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
83
Dockerfile
Normal file
83
Dockerfile
Normal file
@@ -0,0 +1,83 @@
|
||||
# AudioCraft Studio Dockerfile for RunPod
|
||||
# Optimized for NVIDIA RTX 4090 (24GB VRAM)
|
||||
|
||||
FROM nvidia/cuda:12.1-cudnn8-runtime-ubuntu22.04
|
||||
|
||||
# Set environment variables
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PIP_NO_CACHE_DIR=1
|
||||
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
|
||||
# CUDA settings
|
||||
ENV CUDA_HOME=/usr/local/cuda
|
||||
ENV PATH="${CUDA_HOME}/bin:${PATH}"
|
||||
ENV LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
|
||||
|
||||
# AudioCraft settings
|
||||
ENV AUDIOCRAFT_OUTPUT_DIR=/workspace/outputs
|
||||
ENV AUDIOCRAFT_DATA_DIR=/workspace/data
|
||||
ENV AUDIOCRAFT_MODEL_CACHE=/workspace/models
|
||||
ENV AUDIOCRAFT_HOST=0.0.0.0
|
||||
ENV AUDIOCRAFT_GRADIO_PORT=7860
|
||||
ENV AUDIOCRAFT_API_PORT=8000
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
curl \
|
||||
wget \
|
||||
ffmpeg \
|
||||
libsndfile1 \
|
||||
libsox-dev \
|
||||
sox \
|
||||
build-essential \
|
||||
python3.10 \
|
||||
python3.10-venv \
|
||||
python3.10-dev \
|
||||
python3-pip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set Python 3.10 as default
|
||||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 \
|
||||
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
|
||||
|
||||
# Upgrade pip
|
||||
RUN pip install --upgrade pip setuptools wheel
|
||||
|
||||
# Create workspace directory
|
||||
WORKDIR /workspace
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p /workspace/outputs /workspace/data /workspace/models /workspace/app
|
||||
|
||||
# Copy requirements first for caching
|
||||
COPY requirements.txt /workspace/app/
|
||||
WORKDIR /workspace/app
|
||||
|
||||
# Install PyTorch with CUDA support
|
||||
RUN pip install torch==2.1.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
|
||||
|
||||
# Install other requirements
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
# Install AudioCraft from source for latest features
|
||||
RUN pip install git+https://github.com/facebookresearch/audiocraft.git
|
||||
|
||||
# Copy application code
|
||||
COPY . /workspace/app/
|
||||
|
||||
# Create non-root user for security (optional, RunPod often uses root)
|
||||
# RUN useradd -m -u 1000 audiocraft && chown -R audiocraft:audiocraft /workspace
|
||||
# USER audiocraft
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 7860 8000
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
||||
CMD curl -f http://localhost:7860/ || exit 1
|
||||
|
||||
# Default command
|
||||
CMD ["python", "main.py"]
|
||||
Reference in New Issue
Block a user