Spaces:
Sleeping
Sleeping
File size: 616 Bytes
43c5517 |
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 |
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
# Add non-root user
RUN useradd -m -u 1000 user
WORKDIR /home/user/app
# Install dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY --chown=user:user requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy application code
COPY --chown=user:user . .
# Switch to non-root user
USER user
# Expose port
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |