ai_real_detection / Dockerfile
BugFreeAli's picture
Update Dockerfile
a49f59f verified
raw
history blame contribute delete
755 Bytes
# 1. Base Image
FROM python:3.10-slim
# 2. Set working directory
WORKDIR /app
# 3. Install system dependencies
# UPDATED: Added 'libsndfile1' which is required for Audio Processing (Librosa)
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
# 4. Create a non-root user (Hugging Face requirement)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# 5. Copy files with permissions
COPY --chown=user . .
# 6. Install Python Dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# 7. Expose Port
EXPOSE 7860
# 8. Run App
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]