|
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 |
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 |
|
ENV PYTHONUNBUFFERED=1 |
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
ENV TRANSFORMERS_CACHE=/app/.cache |
|
ENV HF_HOME=/app/.cache |
|
ENV HF_HUB_CACHE=/app/.cache |
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
python3 \ |
|
python3-pip \ |
|
python3-dev \ |
|
build-essential \ |
|
git \ |
|
&& apt-get clean \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
RUN pip3 install --no-cache-dir -U pip setuptools wheel |
|
RUN pip3 install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY app.py . |
|
|
|
|
|
CMD ["python3", "app.py"] |
|
|