File size: 1,288 Bytes
cf90384
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99810a9
 
 
 
4bee39c
99810a9
cf90384
 
99810a9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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"]