File size: 1,007 Bytes
9cb0411
f7ab2c4
9cb0411
 
 
 
 
70feffe
 
 
 
 
9cb0411
 
 
 
 
 
 
 
 
 
70feffe
 
 
9cb0411
0ef9213
 
9cb0411
 
 
 
 
 
f7ab2c4
9cb0411
 
0ef9213
9cb0411
70feffe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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"]