cog / Dockerfile
imCuteCat's picture
Update Dockerfile
1029255 verified
raw
history blame
854 Bytes
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 && \
mkdir -p /usr/share/fonts && \
mkdir -p /src/fonts && \
chmod -R 777 /tmp /usr/share/fonts /src/fonts
# Copy the rest of the application code
COPY . /src
# Ensure the directory 'flagged' is writable
RUN mkdir -p /src/flagged && chmod 777 /src/flagged
# Set the working directory
WORKDIR /src
# Set the entry point to run the prediction script
ENTRYPOINT ["python", "predict.py"]