ace-step-api / Dockerfile
fabricationworkshop's picture
Fix host binding: use 0.0.0.0 for HF Spaces proxy access
99810a9 verified
FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04
# Install Python 3.11 and system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 python3.11-venv python3.11-dev python3-pip \
git wget curl libsndfile1 ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Set Python 3.11 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
# Install uv
RUN pip install uv
# Create non-root user for HF Spaces
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user PATH="/home/user/.local/bin:$PATH"
WORKDIR /home/user/app
# Clone ACE-Step 1.5
RUN git clone https://github.com/ACE-Step/ACE-Step-1.5.git /home/user/app/acestep
WORKDIR /home/user/app/acestep
# Install dependencies
RUN uv sync
# Write config for the API (printf for proper newlines)
RUN printf 'ACESTEP_CONFIG_PATH=acestep-v15-turbo\nACESTEP_LM_MODEL_PATH=acestep-5Hz-lm-0.6B\nACESTEP_LM_BACKEND=pt\nACESTEP_API_PORT=7860\nLANGUAGE=en\n' > .env
# HF Spaces requires port 7860 and host 0.0.0.0
ENV ACESTEP_API_PORT=7860
ENV ACESTEP_API_HOST=0.0.0.0
EXPOSE 7860
# Start the ACE-Step API on 0.0.0.0:7860
CMD ["uv", "run", "acestep-api", "--host", "0.0.0.0", "--port", "7860"]