File size: 783 Bytes
4d0e37d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.10-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    gcc \
    g++ \
    && rm -rf /var/lib/apt/lists/*

# Upgrade pip first
RUN pip install --upgrade pip

# Copy requirements and install Python dependencies
COPY requirements.txt .

# Install packages separately for better caching and reliability
RUN pip install --default-timeout=1000 --no-cache-dir flask flask-cors
RUN pip install --default-timeout=1000 --no-cache-dir transformers==4.42.4
RUN pip install --default-timeout=1000 --no-cache-dir torch==2.3.1

# Copy application code
COPY app.py .

# Copy templates folder
COPY templates/ ./templates/

# Copy model files
COPY models/ ./models/

# Expose port
EXPOSE 7860

# Run the application
CMD ["python", "app.py"]