File size: 1,034 Bytes
1f26a10 949b9bd 1f26a10 |
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 38 39 40 41 42 43 44 45 |
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
FROM python:3.11-slim-bullseye
WORKDIR /app
# Enable contrib and non-free repos, and install system dependencies
RUN sed -i 's/main/main contrib non-free/' /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
unrar \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=noninteractive
# Python + dependencies
RUN apt-get update && apt-get install -y python3 python3-pip git && \
pip3 install --upgrade pip
# Set working dir
WORKDIR /app
# Copy and install requirements
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy app code
COPY . .
# ybyjngamhtcuaupc gsmt
# Make the entire /app directory fully writeable for all users
RUN chmod -R 777 /app
# Ensure the app runs as the same user as the Space UI
RUN useradd -m -u 1000 user
USER user
# Launch FastAPI download server on container start
CMD ["uvicorn", ":app", "--host", "0.0.0.0", "--port", "7860"]
|