|
|
FROM python:3.11-slim-bullseye |
|
|
|
|
|
|
|
|
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/* |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip setuptools wheel packaging |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY requirements.txt . |
|
|
RUN pip install --no-cache-dir \ |
|
|
-r requirements.txt \ |
|
|
--find-links https://download.pytorch.org/whl/cpu \ |
|
|
--extra-index-url https://pypi.org/simple && \ |
|
|
|
|
|
pip install --no-cache-dir \ |
|
|
accelerate \ |
|
|
transformers==4.36.2 \ |
|
|
timm==0.9.12 \ |
|
|
einops==0.7.0 |
|
|
|
|
|
|
|
|
COPY . . |
|
|
|
|
|
|
|
|
RUN useradd -m -u 1000 user && \ |
|
|
chown -R user:user /app |
|
|
|
|
|
USER user |
|
|
|
|
|
|
|
|
ENV HF_HUB_DISABLE_PROGRESS=1 |
|
|
ENV TF_CPP_MIN_LOG_LEVEL=3 |
|
|
|
|
|
CMD ["uvicorn", "api_server:app", "--host", "0.0.0.0", "--port", "7860"] |