| FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
|
|
|
| FROM python:3.11-slim-bullseye
|
|
|
| WORKDIR /app
|
|
|
|
|
| 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
|
|
|
|
|
| RUN apt-get update && apt-get install -y python3 python3-pip git && \
|
| pip3 install --upgrade pip
|
|
|
|
|
| WORKDIR /app
|
|
|
|
|
| COPY requirements.txt ./
|
| RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
| COPY . .
|
|
|
|
|
|
|
|
|
| RUN chmod -R 777 /app
|
|
|
|
|
| RUN useradd -m -u 1000 user
|
| USER user
|
|
|
|
|
| CMD ["uvicorn", "tensor_server:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|