FROM python:3.11-slim WORKDIR /app # Install system dependencies (git, ffmpeg, audio libs, curl, build tools) RUN apt-get update && apt-get install -y \ git \ ffmpeg \ libsndfile1 \ curl \ build-essential \ libgomp1 \ ca-certificates \ && rm -rf /var/lib/apt/lists/* # Create a non-root user named "user" with user ID 1000 RUN useradd -m -u 1000 user # Set environment variables for the new user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Install uv (modern Python package manager used by ACE-Step) RUN curl -LsSf https://astral.sh/uv/install.sh | sh # Clone the ACE-Step 1.5 repository (official GitHub source) RUN git clone --depth 1 https://github.com/ACE-Step/ACE-Step-1.5.git acestep-repo # Set environment variables for Gradio server and persistent Hugging Face / cache storage ENV GRADIO_SERVER_NAME=0.0.0.0 ENV GRADIO_SERVER_PORT=7860 ENV GRADIO_ANALYTICS_ENABLED=False ENV TOKENIZERS_PARALLELISM=false ENV TORCHAUDIO_USE_TORCHCODEC=0 ENV HF_HOME=/data/.cache/huggingface ENV TRANSFORMERS_CACHE=/data/.cache/huggingface ENV TORCH_HOME=/data/.cache/torch ENV ACESTEP_HOME=/data ENV PYTHONUNBUFFERED=1 # Sync Python dependencies using uv (reads pyproject.toml from the repo) WORKDIR /app/acestep-repo RUN uv sync # Create persistent storage directories so models, cache, and outputs survive restarts RUN mkdir -p /data/.cache/huggingface /data/models /data/output /data/outputs # Expose the Gradio port EXPOSE 7860 # Start the ACE-Step Gradio interface via uv run CMD cd /app/acestep-repo && \ mkdir -p /data/.cache/huggingface /data/models /data/output /data/outputs && \ echo "Starting ACE-Step v1.5 Gradio interface..." && \ echo "Models and cache are stored in /data for persistence" && \ uv run acestep