Spaces:
Running
Running
File size: 706 Bytes
84f8f32 08e10df 5825e0c 84f8f32 5825e0c b460716 5825e0c b460716 5825e0c 87dd49a 5825e0c ff8b992 87dd49a 5825e0c 84f8f32 44c0f0f 87dd49a |
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 |
FROM python:3.10-slim
# Install system dependencies as root
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
wget \
gnupg \
&& rm -rf /var/lib/apt/lists/*
# Create directories that will be needed later
RUN mkdir -p /home/user/.cache/huggingface /home/user/.local
RUN useradd -m -u 1000 user
RUN chown -R user:user /home/user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
# Copy application files
COPY --chown=user . .
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=UTF-8
EXPOSE 7860
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |