File size: 748 Bytes
024ca8e
3f3b350
024ca8e
8e25aba
 
 
21ac084
8e25aba
 
024ca8e
 
8e25aba
5b83b07
21ac084
 
 
 
 
 
2800759
 
 
3f3b350
024ca8e
73695aa
024ca8e
2800759
 
 
21ac084
8e25aba
 
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
FROM python:3.9-slim

# Install system packages
RUN apt-get update && apt-get install -y \
    ffmpeg \
    imagemagick \
    fontconfig \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Install pip packages
RUN pip install gradio==3.50.2

# Set environment variables for matplotlib and fontconfig
ENV MPLCONFIGDIR=/tmp/matplotlib
ENV FONTCONFIG_PATH=/etc/fonts

# Create needed directories with correct permissions
RUN mkdir /tmp/matplotlib

# Set the working directory
WORKDIR /src

# Copy the rest of the application code
COPY . /src

# Ensure fonts directory exists and create the cache
RUN mkdir -p /src/fonts && \
    fc-cache -fv /src/fonts

# Set the entry point to run the prediction script
ENTRYPOINT ["python", "predict.py"]