Spaces:
Running
Running
File size: 857 Bytes
36863cf |
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 |
# Use Python 3.12 as the base image
FROM python:3.12
# Install system dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
git \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN useradd -m -u 1000 user
WORKDIR /app
# Install Python dependencies directly
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir \
torch \
torchvision \
git+https://github.com/huggingface/transformers \
accelerate \
qwen-vl-utils[decord]==0.0.8 \
fastapi \
uvicorn[standard]
# Copy application files
COPY --chown=user . /app
# Switch to the non-root user
USER user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Command to run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|