Spaces:
Runtime error
Runtime error
File size: 722 Bytes
7b82169 |
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.9
# Set environment variables
ENV MPLCONFIGDIR /tmp/matplotlib-cache
ENV NLTK_DATA /nltk_data
ENV FONTCONFIG_PATH=/tmp/fontconfig-cache
# Create writable directories
RUN mkdir -p /tmp/matplotlib-cache /nltk_data \
&& chmod 777 /tmp/matplotlib-cache /nltk_data
RUN mkdir -p $FONTCONFIG_PATH && chmod 777 $FONTCONFIG_PATH
# Set the working directory
WORKDIR /
# Copy requirements.txt and install dependencies
COPY ./requirements.txt /requirements.txt
RUN pip install --no-cache-dir --upgrade -r /requirements.txt
# Copy the rest of the application files
COPY . .
# Expose the required port
EXPOSE 7860
# Run the application with Gunicorn
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:7860", "app:app"]
|