BeatGenerator / Dockerfile
bharatverse11's picture
Update Dockerfile
b45e7cb verified
raw
history blame contribute delete
783 Bytes
FROM python:3.10-slim
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
libsndfile1 git \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user (HF Spaces requirement)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR /home/user/app
# Install Python deps (torch CPU first — GPU handled by HF runtime)
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir torch torchaudio --index-url https://download.pytorch.org/whl/cpu && \
pip install --no-cache-dir -r requirements.txt
COPY --chown=user app.py .
RUN mkdir -p /tmp/automixai_beats
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]