FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 ENV DEBIAN_FRONTEND=noninteractive # Hugging Face cache locations (feel free to rename as needed) ENV TRANSFORMERS_CACHE=/app/.cache ENV HF_HOME=/app/.cache ENV HF_HUB_CACHE=/app/.cache # Install system dependencies 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/* # Create the cache directory and fix permissions RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache # Set the working directory WORKDIR /app # Copy requirements file COPY requirements.txt . # Install Python dependencies RUN pip3 install --no-cache-dir -U pip setuptools wheel RUN pip3 install --no-cache-dir -r requirements.txt # Copy application code COPY app.py . # Set the default command to run the application CMD ["python3", "app.py"]