File size: 671 Bytes
3f4ce15
 
4bf4a35
 
9f79fe4
 
 
 
 
7fcb72d
3f4ce15
0673a12
a0024c9
7fcb72d
 
6e82314
6c4916c
 
daa84b4
9f79fe4
daa84b4
6c4916c
9f79fe4
0673a12
1cf6170
7fcb72d
1cf6170
9f79fe4
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
FROM python:3.10-slim

WORKDIR /app

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

# Install dependencies
COPY requirements.txt .
RUN pip cache purge && pip install --no-cache-dir -r requirements.txt

# Copy source code
COPY app.py .

# Create cache directories and set permissions
RUN mkdir -p /app/cache /app/cache/matplotlib && chmod -R 777 /app/cache

# Set env vars
ENV HF_HOME=/app/cache \
    MPLCONFIGDIR=/app/cache/matplotlib \
    PYTHONUNBUFFERED=1 \
    PYTHONWARNINGS=ignore::FutureWarning,ignore::UserWarning:torch._utils

EXPOSE 7860

CMD ["python", "app.py"]