|
|
FROM nvidia/cuda:11.8-runtime-ubuntu22.04 |
|
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 |
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
ENV CUDA_VISIBLE_DEVICES=0 |
|
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
python3 \ |
|
|
python3-pip \ |
|
|
python3-venv \ |
|
|
git \ |
|
|
wget \ |
|
|
curl \ |
|
|
libgl1 \ |
|
|
libglib2.0-0 \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
|
|
|
RUN pip3 install --no-cache-dir -U pip && \ |
|
|
pip3 install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
COPY . . |
|
|
|
|
|
|
|
|
RUN mkdir -p /root/.cache/huggingface/hub |
|
|
|
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ |
|
|
CMD curl -f http://localhost:7860 || exit 1 |
|
|
|
|
|
|
|
|
CMD ["python3", "app.py"] |