phantomnode-api / Dockerfile
tripathiji1312's picture
Add Dockerfile for HF Spaces deployment
bbd8cd3
Raw
History Blame Contribute Delete
561 Bytes
FROM python:3.11-slim
# Install ffmpeg (needed for audio format conversion)
RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
# HF Spaces requires a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Install Python dependencies
RUN pip install --no-cache-dir fastapi uvicorn numpy scipy python-multipart
# Copy application code
COPY --chown=user app/ ./app/
# HF Spaces uses port 7860
EXPOSE 7860
CMD ["uvicorn", "app.server:app", "--host", "0.0.0.0", "--port", "7860"]